fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2964 from NovakAnton/feat/react-query-options-error-types

Add type annotations to queryOptions for TanStack Query

authored by

Lubos and committed by
GitHub
cce7e074 448e656b

+961 -701
+5
.changeset/flat-turkeys-laugh.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + **@tanstack/query**: add type annotations to `queryOptions()`
+55 -8
examples/openapi-ts-tanstack-angular-query-experimental/src/client/@tanstack/angular-query-experimental.gen.ts
··· 40 40 DeletePetData, 41 41 DeleteUserData, 42 42 FindPetsByStatusData, 43 + FindPetsByStatusResponse, 43 44 FindPetsByTagsData, 45 + FindPetsByTagsResponse, 44 46 GetInventoryData, 47 + GetInventoryResponse, 45 48 GetOrderByIdData, 49 + GetOrderByIdResponse, 46 50 GetPetByIdData, 51 + GetPetByIdResponse, 47 52 GetUserByNameData, 53 + GetUserByNameResponse, 48 54 LoginUserData, 55 + LoginUserResponse, 49 56 LogoutUserData, 50 57 PlaceOrderData, 51 58 PlaceOrderResponse, ··· 160 167 export const findPetsByStatusOptions = ( 161 168 options: Options<FindPetsByStatusData>, 162 169 ) => 163 - queryOptions({ 170 + queryOptions< 171 + FindPetsByStatusResponse, 172 + DefaultError, 173 + FindPetsByStatusResponse, 174 + ReturnType<typeof findPetsByStatusQueryKey> 175 + >({ 164 176 queryFn: async ({ queryKey, signal }) => { 165 177 const { data } = await findPetsByStatus({ 166 178 ...options, ··· 182 194 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 183 195 */ 184 196 export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => 185 - queryOptions({ 197 + queryOptions< 198 + FindPetsByTagsResponse, 199 + DefaultError, 200 + FindPetsByTagsResponse, 201 + ReturnType<typeof findPetsByTagsQueryKey> 202 + >({ 186 203 queryFn: async ({ queryKey, signal }) => { 187 204 const { data } = await findPetsByTags({ 188 205 ...options, ··· 229 246 * Returns a single pet. 230 247 */ 231 248 export const getPetByIdOptions = (options: Options<GetPetByIdData>) => 232 - queryOptions({ 249 + queryOptions< 250 + GetPetByIdResponse, 251 + DefaultError, 252 + GetPetByIdResponse, 253 + ReturnType<typeof getPetByIdQueryKey> 254 + >({ 233 255 queryFn: async ({ queryKey, signal }) => { 234 256 const { data } = await getPetById({ 235 257 ...options, ··· 309 331 * Returns a map of status codes to quantities. 310 332 */ 311 333 export const getInventoryOptions = (options?: Options<GetInventoryData>) => 312 - queryOptions({ 334 + queryOptions< 335 + GetInventoryResponse, 336 + DefaultError, 337 + GetInventoryResponse, 338 + ReturnType<typeof getInventoryQueryKey> 339 + >({ 313 340 queryFn: async ({ queryKey, signal }) => { 314 341 const { data } = await getInventory({ 315 342 ...options, ··· 385 412 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 386 413 */ 387 414 export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => 388 - queryOptions({ 415 + queryOptions< 416 + GetOrderByIdResponse, 417 + DefaultError, 418 + GetOrderByIdResponse, 419 + ReturnType<typeof getOrderByIdQueryKey> 420 + >({ 389 421 queryFn: async ({ queryKey, signal }) => { 390 422 const { data } = await getOrderById({ 391 423 ...options, ··· 465 497 * Log into the system. 466 498 */ 467 499 export const loginUserOptions = (options?: Options<LoginUserData>) => 468 - queryOptions({ 500 + queryOptions< 501 + LoginUserResponse, 502 + DefaultError, 503 + LoginUserResponse, 504 + ReturnType<typeof loginUserQueryKey> 505 + >({ 469 506 queryFn: async ({ queryKey, signal }) => { 470 507 const { data } = await loginUser({ 471 508 ...options, ··· 487 524 * Log user out of the system. 488 525 */ 489 526 export const logoutUserOptions = (options?: Options<LogoutUserData>) => 490 - queryOptions({ 527 + queryOptions< 528 + unknown, 529 + DefaultError, 530 + unknown, 531 + ReturnType<typeof logoutUserQueryKey> 532 + >({ 491 533 queryFn: async ({ queryKey, signal }) => { 492 534 const { data } = await logoutUser({ 493 535 ...options, ··· 534 576 * Get user detail based on username. 535 577 */ 536 578 export const getUserByNameOptions = (options: Options<GetUserByNameData>) => 537 - queryOptions({ 579 + queryOptions< 580 + GetUserByNameResponse, 581 + DefaultError, 582 + GetUserByNameResponse, 583 + ReturnType<typeof getUserByNameQueryKey> 584 + >({ 538 585 queryFn: async ({ queryKey, signal }) => { 539 586 const { data } = await getUserByName({ 540 587 ...options,
+55 -8
examples/openapi-ts-tanstack-react-query/src/client/@tanstack/react-query.gen.ts
··· 19 19 DeletePetData, 20 20 DeleteUserData, 21 21 FindPetsByStatusData, 22 + FindPetsByStatusResponse, 22 23 FindPetsByTagsData, 24 + FindPetsByTagsResponse, 23 25 GetInventoryData, 26 + GetInventoryResponse, 24 27 GetOrderByIdData, 28 + GetOrderByIdResponse, 25 29 GetPetByIdData, 30 + GetPetByIdResponse, 26 31 GetUserByNameData, 32 + GetUserByNameResponse, 27 33 LoginUserData, 34 + LoginUserResponse, 28 35 LogoutUserData, 29 36 PlaceOrderData, 30 37 PlaceOrderResponse, ··· 143 150 export const findPetsByStatusOptions = ( 144 151 options: Options<FindPetsByStatusData>, 145 152 ) => 146 - queryOptions({ 153 + queryOptions< 154 + FindPetsByStatusResponse, 155 + DefaultError, 156 + FindPetsByStatusResponse, 157 + ReturnType<typeof findPetsByStatusQueryKey> 158 + >({ 147 159 queryFn: async ({ queryKey, signal }) => { 148 160 const { data } = await Sdk.__registry.get().findPetsByStatus({ 149 161 ...options, ··· 165 177 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 166 178 */ 167 179 export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => 168 - queryOptions({ 180 + queryOptions< 181 + FindPetsByTagsResponse, 182 + DefaultError, 183 + FindPetsByTagsResponse, 184 + ReturnType<typeof findPetsByTagsQueryKey> 185 + >({ 169 186 queryFn: async ({ queryKey, signal }) => { 170 187 const { data } = await Sdk.__registry.get().findPetsByTags({ 171 188 ...options, ··· 212 229 * Returns a single pet. 213 230 */ 214 231 export const getPetByIdOptions = (options: Options<GetPetByIdData>) => 215 - queryOptions({ 232 + queryOptions< 233 + GetPetByIdResponse, 234 + DefaultError, 235 + GetPetByIdResponse, 236 + ReturnType<typeof getPetByIdQueryKey> 237 + >({ 216 238 queryFn: async ({ queryKey, signal }) => { 217 239 const { data } = await Sdk.__registry.get().getPetById({ 218 240 ...options, ··· 292 314 * Returns a map of status codes to quantities. 293 315 */ 294 316 export const getInventoryOptions = (options?: Options<GetInventoryData>) => 295 - queryOptions({ 317 + queryOptions< 318 + GetInventoryResponse, 319 + DefaultError, 320 + GetInventoryResponse, 321 + ReturnType<typeof getInventoryQueryKey> 322 + >({ 296 323 queryFn: async ({ queryKey, signal }) => { 297 324 const { data } = await Sdk.__registry.get().getInventory({ 298 325 ...options, ··· 368 395 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 369 396 */ 370 397 export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => 371 - queryOptions({ 398 + queryOptions< 399 + GetOrderByIdResponse, 400 + DefaultError, 401 + GetOrderByIdResponse, 402 + ReturnType<typeof getOrderByIdQueryKey> 403 + >({ 372 404 queryFn: async ({ queryKey, signal }) => { 373 405 const { data } = await Sdk.__registry.get().getOrderById({ 374 406 ...options, ··· 448 480 * Log into the system. 449 481 */ 450 482 export const loginUserOptions = (options?: Options<LoginUserData>) => 451 - queryOptions({ 483 + queryOptions< 484 + LoginUserResponse, 485 + DefaultError, 486 + LoginUserResponse, 487 + ReturnType<typeof loginUserQueryKey> 488 + >({ 452 489 queryFn: async ({ queryKey, signal }) => { 453 490 const { data } = await Sdk.__registry.get().loginUser({ 454 491 ...options, ··· 470 507 * Log user out of the system. 471 508 */ 472 509 export const logoutUserOptions = (options?: Options<LogoutUserData>) => 473 - queryOptions({ 510 + queryOptions< 511 + unknown, 512 + DefaultError, 513 + unknown, 514 + ReturnType<typeof logoutUserQueryKey> 515 + >({ 474 516 queryFn: async ({ queryKey, signal }) => { 475 517 const { data } = await Sdk.__registry.get().logoutUser({ 476 518 ...options, ··· 517 559 * Get user detail based on username. 518 560 */ 519 561 export const getUserByNameOptions = (options: Options<GetUserByNameData>) => 520 - queryOptions({ 562 + queryOptions< 563 + GetUserByNameResponse, 564 + DefaultError, 565 + GetUserByNameResponse, 566 + ReturnType<typeof getUserByNameQueryKey> 567 + >({ 521 568 queryFn: async ({ queryKey, signal }) => { 522 569 const { data } = await Sdk.__registry.get().getUserByName({ 523 570 ...options,
+55 -8
examples/openapi-ts-tanstack-svelte-query/src/client/@tanstack/svelte-query.gen.ts
··· 40 40 DeletePetData, 41 41 DeleteUserData, 42 42 FindPetsByStatusData, 43 + FindPetsByStatusResponse, 43 44 FindPetsByTagsData, 45 + FindPetsByTagsResponse, 44 46 GetInventoryData, 47 + GetInventoryResponse, 45 48 GetOrderByIdData, 49 + GetOrderByIdResponse, 46 50 GetPetByIdData, 51 + GetPetByIdResponse, 47 52 GetUserByNameData, 53 + GetUserByNameResponse, 48 54 LoginUserData, 55 + LoginUserResponse, 49 56 LogoutUserData, 50 57 PlaceOrderData, 51 58 PlaceOrderResponse, ··· 160 167 export const findPetsByStatusOptions = ( 161 168 options: Options<FindPetsByStatusData>, 162 169 ) => 163 - queryOptions({ 170 + queryOptions< 171 + FindPetsByStatusResponse, 172 + DefaultError, 173 + FindPetsByStatusResponse, 174 + ReturnType<typeof findPetsByStatusQueryKey> 175 + >({ 164 176 queryFn: async ({ queryKey, signal }) => { 165 177 const { data } = await findPetsByStatus({ 166 178 ...options, ··· 182 194 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 183 195 */ 184 196 export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => 185 - queryOptions({ 197 + queryOptions< 198 + FindPetsByTagsResponse, 199 + DefaultError, 200 + FindPetsByTagsResponse, 201 + ReturnType<typeof findPetsByTagsQueryKey> 202 + >({ 186 203 queryFn: async ({ queryKey, signal }) => { 187 204 const { data } = await findPetsByTags({ 188 205 ...options, ··· 229 246 * Returns a single pet. 230 247 */ 231 248 export const getPetByIdOptions = (options: Options<GetPetByIdData>) => 232 - queryOptions({ 249 + queryOptions< 250 + GetPetByIdResponse, 251 + DefaultError, 252 + GetPetByIdResponse, 253 + ReturnType<typeof getPetByIdQueryKey> 254 + >({ 233 255 queryFn: async ({ queryKey, signal }) => { 234 256 const { data } = await getPetById({ 235 257 ...options, ··· 309 331 * Returns a map of status codes to quantities. 310 332 */ 311 333 export const getInventoryOptions = (options?: Options<GetInventoryData>) => 312 - queryOptions({ 334 + queryOptions< 335 + GetInventoryResponse, 336 + DefaultError, 337 + GetInventoryResponse, 338 + ReturnType<typeof getInventoryQueryKey> 339 + >({ 313 340 queryFn: async ({ queryKey, signal }) => { 314 341 const { data } = await getInventory({ 315 342 ...options, ··· 385 412 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 386 413 */ 387 414 export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => 388 - queryOptions({ 415 + queryOptions< 416 + GetOrderByIdResponse, 417 + DefaultError, 418 + GetOrderByIdResponse, 419 + ReturnType<typeof getOrderByIdQueryKey> 420 + >({ 389 421 queryFn: async ({ queryKey, signal }) => { 390 422 const { data } = await getOrderById({ 391 423 ...options, ··· 465 497 * Log into the system. 466 498 */ 467 499 export const loginUserOptions = (options?: Options<LoginUserData>) => 468 - queryOptions({ 500 + queryOptions< 501 + LoginUserResponse, 502 + DefaultError, 503 + LoginUserResponse, 504 + ReturnType<typeof loginUserQueryKey> 505 + >({ 469 506 queryFn: async ({ queryKey, signal }) => { 470 507 const { data } = await loginUser({ 471 508 ...options, ··· 487 524 * Log user out of the system. 488 525 */ 489 526 export const logoutUserOptions = (options?: Options<LogoutUserData>) => 490 - queryOptions({ 527 + queryOptions< 528 + unknown, 529 + DefaultError, 530 + unknown, 531 + ReturnType<typeof logoutUserQueryKey> 532 + >({ 491 533 queryFn: async ({ queryKey, signal }) => { 492 534 const { data } = await logoutUser({ 493 535 ...options, ··· 534 576 * Get user detail based on username. 535 577 */ 536 578 export const getUserByNameOptions = (options: Options<GetUserByNameData>) => 537 - queryOptions({ 579 + queryOptions< 580 + GetUserByNameResponse, 581 + DefaultError, 582 + GetUserByNameResponse, 583 + ReturnType<typeof getUserByNameQueryKey> 584 + >({ 538 585 queryFn: async ({ queryKey, signal }) => { 539 586 const { data } = await getUserByName({ 540 587 ...options,
+50 -8
examples/openapi-ts-tanstack-vue-query/src/client/@tanstack/vue-query.gen.ts
··· 36 36 DeletePetData, 37 37 DeleteUserData, 38 38 FindPetsByStatusData, 39 + FindPetsByStatusResponse, 39 40 FindPetsByTagsData, 41 + FindPetsByTagsResponse, 40 42 GetInventoryData, 43 + GetInventoryResponse, 41 44 GetOrderByIdData, 45 + GetOrderByIdResponse, 42 46 GetPetByIdData, 47 + GetPetByIdResponse, 43 48 GetUserByNameData, 49 + GetUserByNameResponse, 44 50 LoginUserData, 51 + LoginUserResponse, 45 52 LogoutUserData, 46 53 PlaceOrderData, 47 54 PlaceOrderResponse, ··· 148 155 * Multiple status values can be provided with comma separated strings. 149 156 */ 150 157 export const findPetsByStatusOptions = (options: Options<FindPetsByStatusData>) => 151 - queryOptions({ 158 + queryOptions< 159 + FindPetsByStatusResponse, 160 + DefaultError, 161 + FindPetsByStatusResponse, 162 + ReturnType<typeof findPetsByStatusQueryKey> 163 + >({ 152 164 queryFn: async ({ queryKey, signal }) => { 153 165 const { data } = await findPetsByStatus({ 154 166 ...options, ··· 170 182 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 171 183 */ 172 184 export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => 173 - queryOptions({ 185 + queryOptions< 186 + FindPetsByTagsResponse, 187 + DefaultError, 188 + FindPetsByTagsResponse, 189 + ReturnType<typeof findPetsByTagsQueryKey> 190 + >({ 174 191 queryFn: async ({ queryKey, signal }) => { 175 192 const { data } = await findPetsByTags({ 176 193 ...options, ··· 213 230 * Returns a single pet. 214 231 */ 215 232 export const getPetByIdOptions = (options: Options<GetPetByIdData>) => 216 - queryOptions({ 233 + queryOptions< 234 + GetPetByIdResponse, 235 + DefaultError, 236 + GetPetByIdResponse, 237 + ReturnType<typeof getPetByIdQueryKey> 238 + >({ 217 239 queryFn: async ({ queryKey, signal }) => { 218 240 const { data } = await getPetById({ 219 241 ...options, ··· 285 307 * Returns a map of status codes to quantities. 286 308 */ 287 309 export const getInventoryOptions = (options?: Options<GetInventoryData>) => 288 - queryOptions({ 310 + queryOptions< 311 + GetInventoryResponse, 312 + DefaultError, 313 + GetInventoryResponse, 314 + ReturnType<typeof getInventoryQueryKey> 315 + >({ 289 316 queryFn: async ({ queryKey, signal }) => { 290 317 const { data } = await getInventory({ 291 318 ...options, ··· 353 380 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 354 381 */ 355 382 export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => 356 - queryOptions({ 383 + queryOptions< 384 + GetOrderByIdResponse, 385 + DefaultError, 386 + GetOrderByIdResponse, 387 + ReturnType<typeof getOrderByIdQueryKey> 388 + >({ 357 389 queryFn: async ({ queryKey, signal }) => { 358 390 const { data } = await getOrderById({ 359 391 ...options, ··· 429 461 * Log into the system. 430 462 */ 431 463 export const loginUserOptions = (options?: Options<LoginUserData>) => 432 - queryOptions({ 464 + queryOptions< 465 + LoginUserResponse, 466 + DefaultError, 467 + LoginUserResponse, 468 + ReturnType<typeof loginUserQueryKey> 469 + >({ 433 470 queryFn: async ({ queryKey, signal }) => { 434 471 const { data } = await loginUser({ 435 472 ...options, ··· 451 488 * Log user out of the system. 452 489 */ 453 490 export const logoutUserOptions = (options?: Options<LogoutUserData>) => 454 - queryOptions({ 491 + queryOptions<unknown, DefaultError, unknown, ReturnType<typeof logoutUserQueryKey>>({ 455 492 queryFn: async ({ queryKey, signal }) => { 456 493 const { data } = await logoutUser({ 457 494 ...options, ··· 494 531 * Get user detail based on username. 495 532 */ 496 533 export const getUserByNameOptions = (options: Options<GetUserByNameData>) => 497 - queryOptions({ 534 + queryOptions< 535 + GetUserByNameResponse, 536 + DefaultError, 537 + GetUserByNameResponse, 538 + ReturnType<typeof getUserByNameQueryKey> 539 + >({ 498 540 queryFn: async ({ queryKey, signal }) => { 499 541 const { data } = await getUserByName({ 500 542 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 8 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 8 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 46 46 47 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 47 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await serviceWithEmptyTag({ 50 50 ...options, ··· 101 101 102 102 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 103 103 104 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 104 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await getCallWithoutParametersAndResponse({ 107 107 ...options, ··· 200 200 201 201 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 202 202 203 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 203 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 204 204 queryFn: async ({ queryKey, signal }) => { 205 205 const { data } = await callWithDefaultParameters({ 206 206 ...options, ··· 257 257 258 258 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 259 259 260 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 260 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 261 261 queryFn: async ({ queryKey, signal }) => { 262 262 const { data } = await duplicateName2({ 263 263 ...options, ··· 300 300 301 301 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 302 302 303 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 303 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 304 304 queryFn: async ({ queryKey, signal }) => { 305 305 const { data } = await callWithNoContentResponse({ 306 306 ...options, ··· 315 315 316 316 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 317 317 318 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 318 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 319 319 queryFn: async ({ queryKey, signal }) => { 320 320 const { data } = await callWithResponseAndNoContentResponse({ 321 321 ...options, ··· 330 330 331 331 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 332 332 333 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 333 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyAQueryKey>>({ 334 334 queryFn: async ({ queryKey, signal }) => { 335 335 const { data } = await dummyA({ 336 336 ...options, ··· 345 345 346 346 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 347 347 348 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 348 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyBQueryKey>>({ 349 349 queryFn: async ({ queryKey, signal }) => { 350 350 const { data } = await dummyB({ 351 351 ...options, ··· 360 360 361 361 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 362 362 363 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 363 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 364 364 queryFn: async ({ queryKey, signal }) => { 365 365 const { data } = await callWithResponse({ 366 366 ...options, ··· 403 403 404 404 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 405 405 406 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 406 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 407 407 queryFn: async ({ queryKey, signal }) => { 408 408 const { data } = await collectionFormat({ 409 409 ...options, ··· 418 418 419 419 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 420 420 421 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 421 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 422 422 queryFn: async ({ queryKey, signal }) => { 423 423 const { data } = await types({ 424 424 ...options, ··· 433 433 434 434 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 435 435 436 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 436 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 437 437 queryFn: async ({ queryKey, signal }) => { 438 438 const { data } = await complexTypes({ 439 439 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 7 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 7 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 45 45 46 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 46 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await serviceWithEmptyTag({ 49 49 ...options, ··· 100 100 101 101 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 102 102 103 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 103 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await getCallWithoutParametersAndResponse({ 106 106 ...options, ··· 199 199 200 200 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 201 201 202 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 202 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 203 203 queryFn: async ({ queryKey, signal }) => { 204 204 const { data } = await callWithDefaultParameters({ 205 205 ...options, ··· 256 256 257 257 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 258 258 259 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 259 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 260 260 queryFn: async ({ queryKey, signal }) => { 261 261 const { data } = await duplicateName2({ 262 262 ...options, ··· 299 299 300 300 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 301 301 302 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 302 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 303 303 queryFn: async ({ queryKey, signal }) => { 304 304 const { data } = await callWithNoContentResponse({ 305 305 ...options, ··· 314 314 315 315 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 316 316 317 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 317 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 318 318 queryFn: async ({ queryKey, signal }) => { 319 319 const { data } = await callWithResponseAndNoContentResponse({ 320 320 ...options, ··· 329 329 330 330 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 331 331 332 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 332 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyAQueryKey>>({ 333 333 queryFn: async ({ queryKey, signal }) => { 334 334 const { data } = await dummyA({ 335 335 ...options, ··· 344 344 345 345 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 346 346 347 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 347 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyBQueryKey>>({ 348 348 queryFn: async ({ queryKey, signal }) => { 349 349 const { data } = await dummyB({ 350 350 ...options, ··· 359 359 360 360 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 361 361 362 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 362 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 363 363 queryFn: async ({ queryKey, signal }) => { 364 364 const { data } = await callWithResponse({ 365 365 ...options, ··· 402 402 403 403 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 404 404 405 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 405 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 406 406 queryFn: async ({ queryKey, signal }) => { 407 407 const { data } = await collectionFormat({ 408 408 ...options, ··· 417 417 418 418 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 419 419 420 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 420 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 421 421 queryFn: async ({ queryKey, signal }) => { 422 422 const { data } = await types({ 423 423 ...options, ··· 432 432 433 433 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 434 434 435 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 435 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 436 436 queryFn: async ({ queryKey, signal }) => { 437 437 const { data } = await complexTypes({ 438 438 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 8 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 8 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 46 46 47 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 47 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await serviceWithEmptyTag({ 50 50 ...options, ··· 101 101 102 102 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 103 103 104 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 104 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await getCallWithoutParametersAndResponse({ 107 107 ...options, ··· 200 200 201 201 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 202 202 203 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 203 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 204 204 queryFn: async ({ queryKey, signal }) => { 205 205 const { data } = await callWithDefaultParameters({ 206 206 ...options, ··· 257 257 258 258 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 259 259 260 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 260 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 261 261 queryFn: async ({ queryKey, signal }) => { 262 262 const { data } = await duplicateName2({ 263 263 ...options, ··· 300 300 301 301 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 302 302 303 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 303 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 304 304 queryFn: async ({ queryKey, signal }) => { 305 305 const { data } = await callWithNoContentResponse({ 306 306 ...options, ··· 315 315 316 316 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 317 317 318 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 318 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 319 319 queryFn: async ({ queryKey, signal }) => { 320 320 const { data } = await callWithResponseAndNoContentResponse({ 321 321 ...options, ··· 330 330 331 331 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 332 332 333 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 333 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyAQueryKey>>({ 334 334 queryFn: async ({ queryKey, signal }) => { 335 335 const { data } = await dummyA({ 336 336 ...options, ··· 345 345 346 346 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 347 347 348 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 348 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyBQueryKey>>({ 349 349 queryFn: async ({ queryKey, signal }) => { 350 350 const { data } = await dummyB({ 351 351 ...options, ··· 360 360 361 361 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 362 362 363 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 363 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 364 364 queryFn: async ({ queryKey, signal }) => { 365 365 const { data } = await callWithResponse({ 366 366 ...options, ··· 403 403 404 404 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 405 405 406 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 406 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 407 407 queryFn: async ({ queryKey, signal }) => { 408 408 const { data } = await collectionFormat({ 409 409 ...options, ··· 418 418 419 419 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 420 420 421 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 421 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 422 422 queryFn: async ({ queryKey, signal }) => { 423 423 const { data } = await types({ 424 424 ...options, ··· 433 433 434 434 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 435 435 436 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 436 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 437 437 queryFn: async ({ queryKey, signal }) => { 438 438 const { data } = await complexTypes({ 439 439 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 7 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 7 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 45 45 46 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 46 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await serviceWithEmptyTag({ 49 49 ...options, ··· 100 100 101 101 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 102 102 103 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 103 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await getCallWithoutParametersAndResponse({ 106 106 ...options, ··· 199 199 200 200 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 201 201 202 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 202 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 203 203 queryFn: async ({ queryKey, signal }) => { 204 204 const { data } = await callWithDefaultParameters({ 205 205 ...options, ··· 256 256 257 257 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 258 258 259 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 259 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 260 260 queryFn: async ({ queryKey, signal }) => { 261 261 const { data } = await duplicateName2({ 262 262 ...options, ··· 299 299 300 300 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 301 301 302 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 302 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 303 303 queryFn: async ({ queryKey, signal }) => { 304 304 const { data } = await callWithNoContentResponse({ 305 305 ...options, ··· 314 314 315 315 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 316 316 317 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 317 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 318 318 queryFn: async ({ queryKey, signal }) => { 319 319 const { data } = await callWithResponseAndNoContentResponse({ 320 320 ...options, ··· 329 329 330 330 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 331 331 332 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 332 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyAQueryKey>>({ 333 333 queryFn: async ({ queryKey, signal }) => { 334 334 const { data } = await dummyA({ 335 335 ...options, ··· 344 344 345 345 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 346 346 347 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 347 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyBQueryKey>>({ 348 348 queryFn: async ({ queryKey, signal }) => { 349 349 const { data } = await dummyB({ 350 350 ...options, ··· 359 359 360 360 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 361 361 362 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 362 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 363 363 queryFn: async ({ queryKey, signal }) => { 364 364 const { data } = await callWithResponse({ 365 365 ...options, ··· 402 402 403 403 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 404 404 405 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 405 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 406 406 queryFn: async ({ queryKey, signal }) => { 407 407 const { data } = await collectionFormat({ 408 408 ...options, ··· 417 417 418 418 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 419 419 420 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 420 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 421 421 queryFn: async ({ queryKey, signal }) => { 422 422 const { data } = await types({ 423 423 ...options, ··· 432 432 433 433 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 434 434 435 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 435 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 436 436 queryFn: async ({ queryKey, signal }) => { 437 437 const { data } = await complexTypes({ 438 438 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 8 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 8 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 46 46 47 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 47 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await serviceWithEmptyTag({ 50 50 ...options, ··· 101 101 102 102 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 103 103 104 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 104 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await getCallWithoutParametersAndResponse({ 107 107 ...options, ··· 200 200 201 201 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 202 202 203 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 203 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 204 204 queryFn: async ({ queryKey, signal }) => { 205 205 const { data } = await callWithDefaultParameters({ 206 206 ...options, ··· 257 257 258 258 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 259 259 260 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 260 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 261 261 queryFn: async ({ queryKey, signal }) => { 262 262 const { data } = await duplicateName2({ 263 263 ...options, ··· 300 300 301 301 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 302 302 303 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 303 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 304 304 queryFn: async ({ queryKey, signal }) => { 305 305 const { data } = await callWithNoContentResponse({ 306 306 ...options, ··· 315 315 316 316 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 317 317 318 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 318 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 319 319 queryFn: async ({ queryKey, signal }) => { 320 320 const { data } = await callWithResponseAndNoContentResponse({ 321 321 ...options, ··· 330 330 331 331 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 332 332 333 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 333 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyAQueryKey>>({ 334 334 queryFn: async ({ queryKey, signal }) => { 335 335 const { data } = await dummyA({ 336 336 ...options, ··· 345 345 346 346 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 347 347 348 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 348 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyBQueryKey>>({ 349 349 queryFn: async ({ queryKey, signal }) => { 350 350 const { data } = await dummyB({ 351 351 ...options, ··· 360 360 361 361 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 362 362 363 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 363 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 364 364 queryFn: async ({ queryKey, signal }) => { 365 365 const { data } = await callWithResponse({ 366 366 ...options, ··· 403 403 404 404 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 405 405 406 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 406 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 407 407 queryFn: async ({ queryKey, signal }) => { 408 408 const { data } = await collectionFormat({ 409 409 ...options, ··· 418 418 419 419 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 420 420 421 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 421 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 422 422 queryFn: async ({ queryKey, signal }) => { 423 423 const { data } = await types({ 424 424 ...options, ··· 433 433 434 434 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 435 435 436 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 436 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 437 437 queryFn: async ({ queryKey, signal }) => { 438 438 const { data } = await complexTypes({ 439 439 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 7 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 7 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 45 45 46 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 46 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await serviceWithEmptyTag({ 49 49 ...options, ··· 100 100 101 101 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 102 102 103 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 103 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await getCallWithoutParametersAndResponse({ 106 106 ...options, ··· 199 199 200 200 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 201 201 202 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 202 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 203 203 queryFn: async ({ queryKey, signal }) => { 204 204 const { data } = await callWithDefaultParameters({ 205 205 ...options, ··· 256 256 257 257 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 258 258 259 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 259 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 260 260 queryFn: async ({ queryKey, signal }) => { 261 261 const { data } = await duplicateName2({ 262 262 ...options, ··· 299 299 300 300 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 301 301 302 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 302 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 303 303 queryFn: async ({ queryKey, signal }) => { 304 304 const { data } = await callWithNoContentResponse({ 305 305 ...options, ··· 314 314 315 315 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 316 316 317 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 317 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 318 318 queryFn: async ({ queryKey, signal }) => { 319 319 const { data } = await callWithResponseAndNoContentResponse({ 320 320 ...options, ··· 329 329 330 330 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 331 331 332 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 332 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyAQueryKey>>({ 333 333 queryFn: async ({ queryKey, signal }) => { 334 334 const { data } = await dummyA({ 335 335 ...options, ··· 344 344 345 345 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 346 346 347 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 347 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyBQueryKey>>({ 348 348 queryFn: async ({ queryKey, signal }) => { 349 349 const { data } = await dummyB({ 350 350 ...options, ··· 359 359 360 360 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 361 361 362 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 362 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 363 363 queryFn: async ({ queryKey, signal }) => { 364 364 const { data } = await callWithResponse({ 365 365 ...options, ··· 402 402 403 403 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 404 404 405 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 405 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 406 406 queryFn: async ({ queryKey, signal }) => { 407 407 const { data } = await collectionFormat({ 408 408 ...options, ··· 417 417 418 418 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 419 419 420 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 420 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 421 421 queryFn: async ({ queryKey, signal }) => { 422 422 const { data } = await types({ 423 423 ...options, ··· 432 432 433 433 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 434 434 435 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 435 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 436 436 queryFn: async ({ queryKey, signal }) => { 437 437 const { data } = await complexTypes({ 438 438 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 8 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 8 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 46 46 47 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 47 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await serviceWithEmptyTag({ 50 50 ...options, ··· 101 101 102 102 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 103 103 104 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 104 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await getCallWithoutParametersAndResponse({ 107 107 ...options, ··· 200 200 201 201 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 202 202 203 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 203 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 204 204 queryFn: async ({ queryKey, signal }) => { 205 205 const { data } = await callWithDefaultParameters({ 206 206 ...options, ··· 257 257 258 258 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 259 259 260 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 260 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 261 261 queryFn: async ({ queryKey, signal }) => { 262 262 const { data } = await duplicateName2({ 263 263 ...options, ··· 300 300 301 301 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 302 302 303 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 303 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 304 304 queryFn: async ({ queryKey, signal }) => { 305 305 const { data } = await callWithNoContentResponse({ 306 306 ...options, ··· 315 315 316 316 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 317 317 318 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 318 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 319 319 queryFn: async ({ queryKey, signal }) => { 320 320 const { data } = await callWithResponseAndNoContentResponse({ 321 321 ...options, ··· 330 330 331 331 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 332 332 333 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 333 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyAQueryKey>>({ 334 334 queryFn: async ({ queryKey, signal }) => { 335 335 const { data } = await dummyA({ 336 336 ...options, ··· 345 345 346 346 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 347 347 348 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 348 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyBQueryKey>>({ 349 349 queryFn: async ({ queryKey, signal }) => { 350 350 const { data } = await dummyB({ 351 351 ...options, ··· 360 360 361 361 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 362 362 363 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 363 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 364 364 queryFn: async ({ queryKey, signal }) => { 365 365 const { data } = await callWithResponse({ 366 366 ...options, ··· 403 403 404 404 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 405 405 406 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 406 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 407 407 queryFn: async ({ queryKey, signal }) => { 408 408 const { data } = await collectionFormat({ 409 409 ...options, ··· 418 418 419 419 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 420 420 421 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 421 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 422 422 queryFn: async ({ queryKey, signal }) => { 423 423 const { data } = await types({ 424 424 ...options, ··· 433 433 434 434 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 435 435 436 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 436 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 437 437 queryFn: async ({ queryKey, signal }) => { 438 438 const { data } = await complexTypes({ 439 439 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 7 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 7 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 45 45 46 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 46 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await serviceWithEmptyTag({ 49 49 ...options, ··· 100 100 101 101 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 102 102 103 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 103 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await getCallWithoutParametersAndResponse({ 106 106 ...options, ··· 199 199 200 200 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 201 201 202 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 202 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 203 203 queryFn: async ({ queryKey, signal }) => { 204 204 const { data } = await callWithDefaultParameters({ 205 205 ...options, ··· 256 256 257 257 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 258 258 259 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 259 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 260 260 queryFn: async ({ queryKey, signal }) => { 261 261 const { data } = await duplicateName2({ 262 262 ...options, ··· 299 299 300 300 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 301 301 302 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 302 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 303 303 queryFn: async ({ queryKey, signal }) => { 304 304 const { data } = await callWithNoContentResponse({ 305 305 ...options, ··· 314 314 315 315 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 316 316 317 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 317 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 318 318 queryFn: async ({ queryKey, signal }) => { 319 319 const { data } = await callWithResponseAndNoContentResponse({ 320 320 ...options, ··· 329 329 330 330 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 331 331 332 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 332 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyAQueryKey>>({ 333 333 queryFn: async ({ queryKey, signal }) => { 334 334 const { data } = await dummyA({ 335 335 ...options, ··· 344 344 345 345 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 346 346 347 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 347 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyBQueryKey>>({ 348 348 queryFn: async ({ queryKey, signal }) => { 349 349 const { data } = await dummyB({ 350 350 ...options, ··· 359 359 360 360 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 361 361 362 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 362 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 363 363 queryFn: async ({ queryKey, signal }) => { 364 364 const { data } = await callWithResponse({ 365 365 ...options, ··· 402 402 403 403 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 404 404 405 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 405 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 406 406 queryFn: async ({ queryKey, signal }) => { 407 407 const { data } = await collectionFormat({ 408 408 ...options, ··· 417 417 418 418 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 419 419 420 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 420 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 421 421 queryFn: async ({ queryKey, signal }) => { 422 422 const { data } = await types({ 423 423 ...options, ··· 432 432 433 433 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 434 434 435 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 435 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 436 436 queryFn: async ({ queryKey, signal }) => { 437 437 const { data } = await complexTypes({ 438 438 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 8 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 8 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 46 46 47 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 47 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await serviceWithEmptyTag({ 50 50 ...options, ··· 101 101 102 102 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 103 103 104 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 104 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await getCallWithoutParametersAndResponse({ 107 107 ...options, ··· 200 200 201 201 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 202 202 203 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 203 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 204 204 queryFn: async ({ queryKey, signal }) => { 205 205 const { data } = await callWithDefaultParameters({ 206 206 ...options, ··· 257 257 258 258 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 259 259 260 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 260 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 261 261 queryFn: async ({ queryKey, signal }) => { 262 262 const { data } = await duplicateName2({ 263 263 ...options, ··· 300 300 301 301 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 302 302 303 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 303 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 304 304 queryFn: async ({ queryKey, signal }) => { 305 305 const { data } = await callWithNoContentResponse({ 306 306 ...options, ··· 315 315 316 316 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 317 317 318 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 318 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 319 319 queryFn: async ({ queryKey, signal }) => { 320 320 const { data } = await callWithResponseAndNoContentResponse({ 321 321 ...options, ··· 330 330 331 331 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 332 332 333 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 333 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyAQueryKey>>({ 334 334 queryFn: async ({ queryKey, signal }) => { 335 335 const { data } = await dummyA({ 336 336 ...options, ··· 345 345 346 346 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 347 347 348 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 348 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof dummyBQueryKey>>({ 349 349 queryFn: async ({ queryKey, signal }) => { 350 350 const { data } = await dummyB({ 351 351 ...options, ··· 360 360 361 361 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 362 362 363 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 363 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 364 364 queryFn: async ({ queryKey, signal }) => { 365 365 const { data } = await callWithResponse({ 366 366 ...options, ··· 403 403 404 404 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 405 405 406 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 406 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 407 407 queryFn: async ({ queryKey, signal }) => { 408 408 const { data } = await collectionFormat({ 409 409 ...options, ··· 418 418 419 419 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 420 420 421 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 421 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 422 422 queryFn: async ({ queryKey, signal }) => { 423 423 const { data } = await types({ 424 424 ...options, ··· 433 433 434 434 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 435 435 436 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 436 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 437 437 queryFn: async ({ queryKey, signal }) => { 438 438 const { data } = await complexTypes({ 439 439 ...options,
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; 7 - import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData } from '../types.gen'; 7 + import type { CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, FooWowData, GetCallWithoutParametersAndResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, ServiceWithEmptyTagData, TestErrorCodeData, TypesData, TypesResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 45 45 46 - export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions({ 46 + export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTagData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof serviceWithEmptyTagQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await serviceWithEmptyTag({ 49 49 ...options, ··· 100 100 101 101 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 102 102 103 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 103 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await getCallWithoutParametersAndResponse({ 106 106 ...options, ··· 199 199 200 200 export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 201 201 202 - export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions({ 202 + export const callWithDefaultParametersOptions = (options: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 203 203 queryFn: async ({ queryKey, signal }) => { 204 204 const { data } = await callWithDefaultParameters({ 205 205 ...options, ··· 256 256 257 257 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 258 258 259 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 259 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 260 260 queryFn: async ({ queryKey, signal }) => { 261 261 const { data } = await duplicateName2({ 262 262 ...options, ··· 299 299 300 300 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 301 301 302 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 302 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 303 303 queryFn: async ({ queryKey, signal }) => { 304 304 const { data } = await callWithNoContentResponse({ 305 305 ...options, ··· 314 314 315 315 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 316 316 317 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 317 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 318 318 queryFn: async ({ queryKey, signal }) => { 319 319 const { data } = await callWithResponseAndNoContentResponse({ 320 320 ...options, ··· 329 329 330 330 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 331 331 332 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 332 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyAQueryKey>>({ 333 333 queryFn: async ({ queryKey, signal }) => { 334 334 const { data } = await dummyA({ 335 335 ...options, ··· 344 344 345 345 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 346 346 347 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 347 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyBQueryKey>>({ 348 348 queryFn: async ({ queryKey, signal }) => { 349 349 const { data } = await dummyB({ 350 350 ...options, ··· 359 359 360 360 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 361 361 362 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 362 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 363 363 queryFn: async ({ queryKey, signal }) => { 364 364 const { data } = await callWithResponse({ 365 365 ...options, ··· 402 402 403 403 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 404 404 405 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 405 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 406 406 queryFn: async ({ queryKey, signal }) => { 407 407 const { data } = await collectionFormat({ 408 408 ...options, ··· 417 417 418 418 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 419 419 420 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 420 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 421 421 queryFn: async ({ queryKey, signal }) => { 422 422 const { data } = await types({ 423 423 ...options, ··· 432 432 433 433 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 434 434 435 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 435 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 436 436 queryFn: async ({ queryKey, signal }) => { 437 437 const { data } = await complexTypes({ 438 438 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+1 -1
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts
··· 43 43 44 44 export const createQueryKey2 = (options?: Options<CreateData>) => createQueryKey('create', options); 45 45 46 - export const createOptions = (options?: Options<CreateData>) => queryOptions({ 46 + export const createOptions = (options?: Options<CreateData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof createQueryKey2>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await create({ 49 49 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/name-builder/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/name-builder/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/name-builder/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/name-builder/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/name-builder/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+1 -1
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts
··· 43 43 44 44 export const createQueryKey2 = (options?: Options<CreateData>) => createQueryKey('create', options); 45 45 46 - export const createOptions = (options?: Options<CreateData>) => queryOptions({ 46 + export const createOptions = (options?: Options<CreateData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof createQueryKey2>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await create({ 49 49 ...options,
+1 -1
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/pagination-ref/@tanstack/react-query.gen.ts
··· 43 43 44 44 export const getFooQueryKey = (options: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/@tanstack/angular-query-experimental.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/name-builder/@tanstack/angular-query-experimental.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/@tanstack/react-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/name-builder/@tanstack/react-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/@tanstack/solid-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/name-builder/@tanstack/solid-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/@tanstack/svelte-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/name-builder/@tanstack/svelte-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { BarBazService, FooBazService, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await FooBazService.getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarOptions = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarQueryKey>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await BarBazService.getFooBar({ 92 92 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/@tanstack/vue-query.gen.ts
··· 5 5 6 6 import { client } from '../client.gen'; 7 7 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 8 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 8 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 9 9 10 10 export type QueryKey<TOptions extends Options> = [ 11 11 Pick<TOptions, 'baseURL' | 'body' | 'headers' | 'path' | 'query'> & { ··· 44 44 45 45 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 46 46 47 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 47 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof exportQueryKey>>({ 48 48 queryFn: async ({ queryKey, signal }) => { 49 49 const { data } = await export_({ 50 50 ...options, ··· 101 101 102 102 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 103 103 104 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 104 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, AxiosError<DefaultError>, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 105 105 queryFn: async ({ queryKey, signal }) => { 106 106 const { data } = await apiVVersionODataControllerCount({ 107 107 ...options, ··· 116 116 117 117 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 118 118 119 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 119 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, AxiosError<GetApiVbyApiVersionSimpleOperationError>, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 120 120 queryFn: async ({ queryKey, signal }) => { 121 121 const { data } = await getApiVbyApiVersionSimpleOperation({ 122 122 ...options, ··· 145 145 146 146 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 147 147 148 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 148 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 149 149 queryFn: async ({ queryKey, signal }) => { 150 150 const { data } = await getCallWithoutParametersAndResponse({ 151 151 ...options, ··· 275 275 276 276 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 277 277 278 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 278 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 279 279 queryFn: async ({ queryKey, signal }) => { 280 280 const { data } = await getCallWithOptionalParam({ 281 281 ...options, ··· 389 389 390 390 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 391 391 392 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 392 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 393 393 queryFn: async ({ queryKey, signal }) => { 394 394 const { data } = await callWithDefaultParameters({ 395 395 ...options, ··· 446 446 447 447 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 448 448 449 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 449 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 450 450 queryFn: async ({ queryKey, signal }) => { 451 451 const { data } = await duplicateName2({ 452 452 ...options, ··· 489 489 490 490 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 491 491 492 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 492 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, AxiosError<DefaultError>, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 493 493 queryFn: async ({ queryKey, signal }) => { 494 494 const { data } = await callWithNoContentResponse({ 495 495 ...options, ··· 504 504 505 505 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 506 506 507 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 507 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, AxiosError<DefaultError>, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 508 508 queryFn: async ({ queryKey, signal }) => { 509 509 const { data } = await callWithResponseAndNoContentResponse({ 510 510 ...options, ··· 519 519 520 520 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 521 521 522 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 522 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, AxiosError<DefaultError>, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 523 523 queryFn: async ({ queryKey, signal }) => { 524 524 const { data } = await dummyA({ 525 525 ...options, ··· 534 534 535 535 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 536 536 537 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 537 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, AxiosError<DefaultError>, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 538 538 queryFn: async ({ queryKey, signal }) => { 539 539 const { data } = await dummyB({ 540 540 ...options, ··· 549 549 550 550 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 551 551 552 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 552 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, AxiosError<DefaultError>, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 553 553 queryFn: async ({ queryKey, signal }) => { 554 554 const { data } = await callWithResponse({ 555 555 ...options, ··· 592 592 593 593 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 594 594 595 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 595 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, AxiosError<DefaultError>, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 596 596 queryFn: async ({ queryKey, signal }) => { 597 597 const { data } = await collectionFormat({ 598 598 ...options, ··· 607 607 608 608 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 609 609 610 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 610 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, AxiosError<DefaultError>, TypesResponse, ReturnType<typeof typesQueryKey>>({ 611 611 queryFn: async ({ queryKey, signal }) => { 612 612 const { data } = await types({ 613 613 ...options, ··· 636 636 637 637 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 638 638 639 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 639 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, AxiosError<DefaultError>, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 640 640 queryFn: async ({ queryKey, signal }) => { 641 641 const { data } = await fileResponse({ 642 642 ...options, ··· 651 651 652 652 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 653 653 654 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 654 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, AxiosError<DefaultError>, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 655 655 queryFn: async ({ queryKey, signal }) => { 656 656 const { data } = await complexTypes({ 657 657 ...options, ··· 666 666 667 667 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 668 668 669 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 669 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, AxiosError<DefaultError>, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 670 670 queryFn: async ({ queryKey, signal }) => { 671 671 const { data } = await multipartResponse({ 672 672 ...options,
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; 7 - import type { ApiVVersionODataControllerCountData, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseData, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyBData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, UploadFileData, UploadFileResponse } from '../types.gen'; 7 + import type { ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, CallToTestOrderOfParamsData, CallWithDefaultOptionalParametersData, CallWithDefaultParametersData, CallWithDescriptionsData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithParametersData, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, CallWithResponseData, CallWithResponseResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CallWithResultFromHeaderData, CallWithWeirdParameterNamesData, CollectionFormatData, ComplexParamsData, ComplexParamsResponse, ComplexTypesData, ComplexTypesResponse, DeleteCallWithoutParametersAndResponseData, DeleteFooData3, DeprecatedCallData, DummyAData, DummyAResponse, DummyBData, DummyBResponse, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, DuplicateNameData, ExportData, FileResponseData, FileResponseResponse, FooWowData, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, GetCallWithOptionalParamData, GetCallWithoutParametersAndResponseData, ImportData, ImportResponse, MultipartRequestData, MultipartResponseData, MultipartResponseResponse, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PatchApiVbyApiVersionNoTagData, PatchCallWithoutParametersAndResponseData, PostApiVbyApiVersionFormDataData, PostApiVbyApiVersionRequestBodyData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, PutWithFormUrlEncodedData, TestErrorCodeData, TypesData, TypesResponse, UploadFileData, UploadFileResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 45 45 46 - export const exportOptions = (options?: Options<ExportData>) => queryOptions({ 46 + export const exportOptions = (options?: Options<ExportData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof exportQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await export_({ 49 49 ...options, ··· 100 100 101 101 export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 102 102 103 - export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions({ 103 + export const apiVVersionODataControllerCountOptions = (options?: Options<ApiVVersionODataControllerCountData>) => queryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse, ReturnType<typeof apiVVersionODataControllerCountQueryKey>>({ 104 104 queryFn: async ({ queryKey, signal }) => { 105 105 const { data } = await apiVVersionODataControllerCount({ 106 106 ...options, ··· 115 115 116 116 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 117 117 118 - export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions({ 118 + export const getApiVbyApiVersionSimpleOperationOptions = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => queryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, ReturnType<typeof getApiVbyApiVersionSimpleOperationQueryKey>>({ 119 119 queryFn: async ({ queryKey, signal }) => { 120 120 const { data } = await getApiVbyApiVersionSimpleOperation({ 121 121 ...options, ··· 144 144 145 145 export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 146 146 147 - export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions({ 147 + export const getCallWithoutParametersAndResponseOptions = (options?: Options<GetCallWithoutParametersAndResponseData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithoutParametersAndResponseQueryKey>>({ 148 148 queryFn: async ({ queryKey, signal }) => { 149 149 const { data } = await getCallWithoutParametersAndResponse({ 150 150 ...options, ··· 274 274 275 275 export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 276 276 277 - export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions({ 277 + export const getCallWithOptionalParamOptions = (options: Options<GetCallWithOptionalParamData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getCallWithOptionalParamQueryKey>>({ 278 278 queryFn: async ({ queryKey, signal }) => { 279 279 const { data } = await getCallWithOptionalParam({ 280 280 ...options, ··· 388 388 389 389 export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 390 390 391 - export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions({ 391 + export const callWithDefaultParametersOptions = (options?: Options<CallWithDefaultParametersData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof callWithDefaultParametersQueryKey>>({ 392 392 queryFn: async ({ queryKey, signal }) => { 393 393 const { data } = await callWithDefaultParameters({ 394 394 ...options, ··· 445 445 446 446 export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 447 447 448 - export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions({ 448 + export const duplicateName2Options = (options?: Options<DuplicateName2Data>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof duplicateName2QueryKey>>({ 449 449 queryFn: async ({ queryKey, signal }) => { 450 450 const { data } = await duplicateName2({ 451 451 ...options, ··· 488 488 489 489 export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 490 490 491 - export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions({ 491 + export const callWithNoContentResponseOptions = (options?: Options<CallWithNoContentResponseData>) => queryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse, ReturnType<typeof callWithNoContentResponseQueryKey>>({ 492 492 queryFn: async ({ queryKey, signal }) => { 493 493 const { data } = await callWithNoContentResponse({ 494 494 ...options, ··· 503 503 504 504 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 505 505 506 - export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions({ 506 + export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({ 507 507 queryFn: async ({ queryKey, signal }) => { 508 508 const { data } = await callWithResponseAndNoContentResponse({ 509 509 ...options, ··· 518 518 519 519 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 520 520 521 - export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions({ 521 + export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<DummyAResponse, DefaultError, DummyAResponse, ReturnType<typeof dummyAQueryKey>>({ 522 522 queryFn: async ({ queryKey, signal }) => { 523 523 const { data } = await dummyA({ 524 524 ...options, ··· 533 533 534 534 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 535 535 536 - export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions({ 536 + export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<DummyBResponse, DefaultError, DummyBResponse, ReturnType<typeof dummyBQueryKey>>({ 537 537 queryFn: async ({ queryKey, signal }) => { 538 538 const { data } = await dummyB({ 539 539 ...options, ··· 548 548 549 549 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 550 550 551 - export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions({ 551 + export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({ 552 552 queryFn: async ({ queryKey, signal }) => { 553 553 const { data } = await callWithResponse({ 554 554 ...options, ··· 591 591 592 592 export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 593 593 594 - export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions({ 594 + export const collectionFormatOptions = (options: Options<CollectionFormatData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof collectionFormatQueryKey>>({ 595 595 queryFn: async ({ queryKey, signal }) => { 596 596 const { data } = await collectionFormat({ 597 597 ...options, ··· 606 606 607 607 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 608 608 609 - export const typesOptions = (options: Options<TypesData>) => queryOptions({ 609 + export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({ 610 610 queryFn: async ({ queryKey, signal }) => { 611 611 const { data } = await types({ 612 612 ...options, ··· 635 635 636 636 export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 637 637 638 - export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions({ 638 + export const fileResponseOptions = (options: Options<FileResponseData>) => queryOptions<FileResponseResponse, DefaultError, FileResponseResponse, ReturnType<typeof fileResponseQueryKey>>({ 639 639 queryFn: async ({ queryKey, signal }) => { 640 640 const { data } = await fileResponse({ 641 641 ...options, ··· 650 650 651 651 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 652 652 653 - export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions({ 653 + export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({ 654 654 queryFn: async ({ queryKey, signal }) => { 655 655 const { data } = await complexTypes({ 656 656 ...options, ··· 665 665 666 666 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 667 667 668 - export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions({ 668 + export const multipartResponseOptions = (options?: Options<MultipartResponseData>) => queryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse, ReturnType<typeof multipartResponseQueryKey>>({ 669 669 queryFn: async ({ queryKey, signal }) => { 670 670 const { data } = await multipartResponse({ 671 671 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/name-builder/@tanstack/vue-query.gen.ts
··· 4 4 5 5 import { client } from '../client.gen'; 6 6 import { fooBarPost, fooBarPut, fooPost, fooPut, getFoo, getFooBar, type Options } from '../sdk.gen'; 7 - import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooData } from '../types.gen'; 7 + import type { FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, GetFooBarResponse, GetFooData, GetFooResponse } from '../types.gen'; 8 8 9 9 export type QueryKey<TOptions extends Options> = [ 10 10 Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & { ··· 43 43 44 44 export const getFooD = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooE = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooE = (options?: Options<GetFooData>) => queryOptions<GetFooResponse, DefaultError, GetFooResponse, ReturnType<typeof getFooD>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 86 86 87 87 export const getFooBarD = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 88 88 89 - export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions({ 89 + export const getFooBarE = (options?: Options<GetFooBarData>) => queryOptions<GetFooBarResponse, DefaultError, GetFooBarResponse, ReturnType<typeof getFooBarD>>({ 90 90 queryFn: async ({ queryKey, signal }) => { 91 91 const { data } = await getFooBar({ 92 92 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/@tanstack/angular-query-experimental.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { queryOptions } from '@tanstack/angular-query-experimental'; 3 + import { type DefaultError, queryOptions } from '@tanstack/angular-query-experimental'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { getBar, getFoo, type Options } from '../sdk.gen'; ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 63 63 64 64 export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options); 65 65 66 - export const getBarOptions = (options?: Options<GetBarData>) => queryOptions({ 66 + export const getBarOptions = (options?: Options<GetBarData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getBarQueryKey>>({ 67 67 queryFn: async ({ queryKey, signal }) => { 68 68 const { data } = await getBar({ 69 69 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/@tanstack/react-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { queryOptions } from '@tanstack/react-query'; 3 + import { type DefaultError, queryOptions } from '@tanstack/react-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { getBar, getFoo, type Options } from '../sdk.gen'; ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 63 63 64 64 export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options); 65 65 66 - export const getBarOptions = (options?: Options<GetBarData>) => queryOptions({ 66 + export const getBarOptions = (options?: Options<GetBarData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getBarQueryKey>>({ 67 67 queryFn: async ({ queryKey, signal }) => { 68 68 const { data } = await getBar({ 69 69 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/@tanstack/solid-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { queryOptions } from '@tanstack/solid-query'; 3 + import { type DefaultError, queryOptions } from '@tanstack/solid-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { getBar, getFoo, type Options } from '../sdk.gen'; ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 63 63 64 64 export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options); 65 65 66 - export const getBarOptions = (options?: Options<GetBarData>) => queryOptions({ 66 + export const getBarOptions = (options?: Options<GetBarData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getBarQueryKey>>({ 67 67 queryFn: async ({ queryKey, signal }) => { 68 68 const { data } = await getBar({ 69 69 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/@tanstack/svelte-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { queryOptions } from '@tanstack/svelte-query'; 3 + import { type DefaultError, queryOptions } from '@tanstack/svelte-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { getBar, getFoo, type Options } from '../sdk.gen'; ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 63 63 64 64 export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options); 65 65 66 - export const getBarOptions = (options?: Options<GetBarData>) => queryOptions({ 66 + export const getBarOptions = (options?: Options<GetBarData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getBarQueryKey>>({ 67 67 queryFn: async ({ queryKey, signal }) => { 68 68 const { data } = await getBar({ 69 69 ...options,
+3 -3
packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/@tanstack/vue-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { queryOptions } from '@tanstack/vue-query'; 3 + import { type DefaultError, queryOptions } from '@tanstack/vue-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { getBar, getFoo, type Options } from '../sdk.gen'; ··· 43 43 44 44 export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 45 45 46 - export const getFooOptions = (options?: Options<GetFooData>) => queryOptions({ 46 + export const getFooOptions = (options?: Options<GetFooData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getFooQueryKey>>({ 47 47 queryFn: async ({ queryKey, signal }) => { 48 48 const { data } = await getFoo({ 49 49 ...options, ··· 63 63 64 64 export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options); 65 65 66 - export const getBarOptions = (options?: Options<GetBarData>) => queryOptions({ 66 + export const getBarOptions = (options?: Options<GetBarData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof getBarQueryKey>>({ 67 67 queryFn: async ({ queryKey, signal }) => { 68 68 const { data } = await getBar({ 69 69 ...options,
+14 -2
packages/openapi-ts/src/plugins/@tanstack/query-core/v5/queryOptions.ts
··· 14 14 queryKeyStatement, 15 15 } from '../queryKey'; 16 16 import { handleMeta } from '../shared/meta'; 17 - import { useTypeData } from '../shared/useType'; 17 + import { useTypeData, useTypeError, useTypeResponse } from '../shared/useType'; 18 18 import type { PluginInstance } from '../types'; 19 19 20 20 const optionsParamName = 'options'; ··· 69 69 plugin.setSymbolValue(symbolQueryKey, node); 70 70 71 71 const typeData = useTypeData({ operation, plugin }); 72 + const typeError = useTypeError({ operation, plugin }); 73 + const typeResponse = useTypeResponse({ operation, plugin }); 72 74 73 75 const awaitSdkFn = $(queryFn) 74 76 .call( ··· 131 133 .param(optionsParamName, (p) => 132 134 p.optional(!isRequiredOptions).type(typeData), 133 135 ) 134 - .do($(symbolQueryOptions.placeholder).call(queryOptionsObj).return()), 136 + .do( 137 + $(symbolQueryOptions.placeholder) 138 + .call(queryOptionsObj) 139 + .generics( 140 + typeResponse, 141 + typeError, 142 + typeResponse, 143 + $(symbolQueryKey.placeholder).returnType(), 144 + ) 145 + .return(), 146 + ), 135 147 ); 136 148 plugin.setSymbolValue(symbolQueryOptionsFn, statement); 137 149 };
+4 -3
packages/openapi-ts/src/ts-dsl/call.ts
··· 6 6 import { AccessMixin, registerLazyAccessCallFactory } from './mixins/access'; 7 7 import { mixin } from './mixins/apply'; 8 8 import { ArgsMixin } from './mixins/args'; 9 + import { TypeArgsMixin } from './mixins/type-args'; 9 10 10 11 export class CallTsDsl extends TsDsl<ts.CallExpression> { 11 12 private _callee: MaybeTsDsl<WithString>; ··· 22 23 $render(): ts.CallExpression { 23 24 return ts.factory.createCallExpression( 24 25 this.$node(this._callee), 25 - undefined, 26 + this.$generics(), 26 27 this.$args(), 27 28 ); 28 29 } 29 30 } 30 31 31 - export interface CallTsDsl extends AccessMixin, ArgsMixin {} 32 - mixin(CallTsDsl, AccessMixin, ArgsMixin); 32 + export interface CallTsDsl extends AccessMixin, ArgsMixin, TypeArgsMixin {} 33 + mixin(CallTsDsl, AccessMixin, ArgsMixin, TypeArgsMixin); 33 34 34 35 registerLazyAccessCallFactory((expr, args) => new CallTsDsl(expr, ...args));
+3 -3
packages/openapi-ts/src/ts-dsl/class.ts
··· 9 9 import { mixin } from './mixins/apply'; 10 10 import { DecoratorMixin } from './mixins/decorator'; 11 11 import { DescribeMixin } from './mixins/describe'; 12 - import { GenericsMixin } from './mixins/generics'; 13 12 import { 14 13 AbstractMixin, 15 14 createModifierAccessor, 16 15 DefaultMixin, 17 16 ExportMixin, 18 17 } from './mixins/modifiers'; 18 + import { TypeParamsMixin } from './mixins/type-params'; 19 19 import { NewlineTsDsl } from './newline'; 20 20 21 21 export class ClassTsDsl extends TsDsl<ts.ClassDeclaration> { ··· 96 96 DescribeMixin, 97 97 DefaultMixin, 98 98 ExportMixin, 99 - GenericsMixin {} 99 + TypeParamsMixin {} 100 100 mixin( 101 101 ClassTsDsl, 102 102 AbstractMixin, ··· 104 104 [DescribeMixin, { overrideRender: true }], 105 105 DefaultMixin, 106 106 ExportMixin, 107 - GenericsMixin, 107 + TypeParamsMixin, 108 108 );
+10
packages/openapi-ts/src/ts-dsl/expr.ts
··· 6 6 import { AccessMixin } from './mixins/access'; 7 7 import { mixin } from './mixins/apply'; 8 8 import { OperatorMixin } from './mixins/operator'; 9 + import { TypeExprTsDsl } from './type/expr'; 10 + import { TypeQueryTsDsl } from './type/query'; 9 11 10 12 export class ExprTsDsl extends TsDsl<ts.Expression> { 11 13 private _exprInput: MaybeTsDsl<WithString>; ··· 13 15 constructor(id: MaybeTsDsl<WithString>) { 14 16 super(); 15 17 this._exprInput = id; 18 + } 19 + 20 + typeof(): TypeQueryTsDsl { 21 + return new TypeQueryTsDsl(this); 22 + } 23 + 24 + returnType(): TypeExprTsDsl { 25 + return new TypeExprTsDsl('ReturnType').generic(this.typeof()); 16 26 } 17 27 18 28 $render(): ts.Expression {
+4 -4
packages/openapi-ts/src/ts-dsl/func.ts
··· 6 6 import { DecoratorMixin } from './mixins/decorator'; 7 7 import { DescribeMixin } from './mixins/describe'; 8 8 import { DoMixin } from './mixins/do'; 9 - import { GenericsMixin } from './mixins/generics'; 10 9 import { 11 10 AbstractMixin, 12 11 AsyncMixin, ··· 18 17 } from './mixins/modifiers'; 19 18 import { OptionalMixin } from './mixins/optional'; 20 19 import { ParamMixin } from './mixins/param'; 20 + import { TypeParamsMixin } from './mixins/type-params'; 21 21 import { TypeExprTsDsl } from './type/expr'; 22 22 23 23 type FuncMode = 'arrow' | 'decl' | 'expr'; ··· 127 127 DecoratorMixin, 128 128 DescribeMixin, 129 129 DoMixin, 130 - GenericsMixin, 131 130 OptionalMixin, 132 131 ParamMixin, 133 132 PrivateMixin, 134 133 ProtectedMixin, 135 134 PublicMixin, 136 - StaticMixin {} 135 + StaticMixin, 136 + TypeParamsMixin {} 137 137 mixin( 138 138 ImplFuncTsDsl, 139 139 AbstractMixin, ··· 141 141 DecoratorMixin, 142 142 [DescribeMixin, { overrideRender: true }], 143 143 DoMixin, 144 - GenericsMixin, 145 144 OptionalMixin, 146 145 ParamMixin, 147 146 PrivateMixin, 148 147 ProtectedMixin, 149 148 PublicMixin, 150 149 StaticMixin, 150 + TypeParamsMixin, 151 151 ); 152 152 153 153 export const FuncTsDsl = ImplFuncTsDsl as {
+4 -4
packages/openapi-ts/src/ts-dsl/method.ts
··· 6 6 import { DecoratorMixin } from './mixins/decorator'; 7 7 import { DescribeMixin } from './mixins/describe'; 8 8 import { DoMixin } from './mixins/do'; 9 - import { GenericsMixin } from './mixins/generics'; 10 9 import { 11 10 AbstractMixin, 12 11 AsyncMixin, ··· 18 17 } from './mixins/modifiers'; 19 18 import { OptionalMixin } from './mixins/optional'; 20 19 import { ParamMixin } from './mixins/param'; 20 + import { TypeParamsMixin } from './mixins/type-params'; 21 21 import { TypeExprTsDsl } from './type/expr'; 22 22 23 23 export class MethodTsDsl extends TsDsl<ts.MethodDeclaration> { ··· 58 58 DecoratorMixin, 59 59 DescribeMixin, 60 60 DoMixin, 61 - GenericsMixin, 62 61 OptionalMixin, 63 62 ParamMixin, 64 63 PrivateMixin, 65 64 ProtectedMixin, 66 65 PublicMixin, 67 - StaticMixin {} 66 + StaticMixin, 67 + TypeParamsMixin {} 68 68 mixin( 69 69 MethodTsDsl, 70 70 AbstractMixin, ··· 72 72 DecoratorMixin, 73 73 [DescribeMixin, { overrideRender: true }], 74 74 DoMixin, 75 - GenericsMixin, 76 75 OptionalMixin, 77 76 ParamMixin, 78 77 PrivateMixin, 79 78 ProtectedMixin, 80 79 PublicMixin, 81 80 StaticMixin, 81 + TypeParamsMixin, 82 82 );
-44
packages/openapi-ts/src/ts-dsl/mixins/generics.ts
··· 1 - import ts from 'typescript'; 2 - 3 - import type { MaybeTsDsl, TypeOfTsDsl } from '../base'; 4 - import { TsDsl } from '../base'; 5 - import { TypeParamTsDsl } from '../type/param'; 6 - 7 - export class GenericsMixin extends TsDsl { 8 - protected _generics?: Array<string | MaybeTsDsl<TypeOfTsDsl<TypeParamTsDsl>>>; 9 - 10 - /** Adds a single generic type argument (e.g. `T` in `Array<T>`). */ 11 - generic(...args: ConstructorParameters<typeof TypeParamTsDsl>): this { 12 - const g = new TypeParamTsDsl(...args); 13 - (this._generics ??= []).push(g); 14 - return this; 15 - } 16 - 17 - /** Adds generic type arguments (e.g. `Map<string, T>`). */ 18 - generics( 19 - ...args: ReadonlyArray<string | MaybeTsDsl<TypeOfTsDsl<TypeParamTsDsl>>> 20 - ): this { 21 - this._generics = [...args]; 22 - return this; 23 - } 24 - 25 - protected $generics(): 26 - | ReadonlyArray<TypeOfTsDsl<TypeParamTsDsl>> 27 - | undefined { 28 - return this._generics?.map((g) => { 29 - if (typeof g === 'string') { 30 - return ts.factory.createTypeParameterDeclaration( 31 - undefined, 32 - this.$expr(g), 33 - undefined, 34 - undefined, 35 - ); 36 - } 37 - return this.$node(g); 38 - }); 39 - } 40 - 41 - $render(): ts.Node { 42 - throw new Error('noop'); 43 - } 44 - }
+33
packages/openapi-ts/src/ts-dsl/mixins/type-args.ts
··· 1 + import type ts from 'typescript'; 2 + 3 + import type { MaybeTsDsl, TypeOfTsDsl, TypeTsDsl, WithString } from '../base'; 4 + import { TsDsl } from '../base'; 5 + 6 + export class TypeArgsMixin extends TsDsl { 7 + protected _generics?: Array<WithString<MaybeTsDsl<TypeOfTsDsl<TypeTsDsl>>>>; 8 + 9 + /** Adds a single type argument (e.g. `string` in `Foo<string>`). */ 10 + generic(arg: WithString<MaybeTsDsl<TypeOfTsDsl<TypeTsDsl>>>): this { 11 + (this._generics ??= []).push(arg); 12 + return this; 13 + } 14 + 15 + /** Adds type arguments (e.g. `Map<string, number>`). */ 16 + generics( 17 + ...args: ReadonlyArray<WithString<MaybeTsDsl<TypeOfTsDsl<TypeTsDsl>>>> 18 + ): this { 19 + this._generics = [...args]; 20 + return this; 21 + } 22 + 23 + /** 24 + * Returns the type arguments as an array of ts.TypeNode nodes. 25 + */ 26 + protected $generics(): ReadonlyArray<ts.TypeNode> | undefined { 27 + return this.$type(this._generics); 28 + } 29 + 30 + $render(): ts.Node { 31 + throw new Error('noop'); 32 + } 33 + }
+40
packages/openapi-ts/src/ts-dsl/mixins/type-params.ts
··· 1 + import type ts from 'typescript'; 2 + 3 + import type { MaybeTsDsl, TypeOfTsDsl } from '../base'; 4 + import { TsDsl } from '../base'; 5 + import { TypeParamTsDsl } from '../type/param'; 6 + 7 + export class TypeParamsMixin extends TsDsl { 8 + protected _generics?: Array<string | MaybeTsDsl<TypeOfTsDsl<TypeParamTsDsl>>>; 9 + 10 + /** Adds a single type parameter (e.g. `T` in `Array<T>`). */ 11 + generic(...args: ConstructorParameters<typeof TypeParamTsDsl>): this { 12 + const g = new TypeParamTsDsl(...args); 13 + (this._generics ??= []).push(g); 14 + return this; 15 + } 16 + 17 + /** Adds type parameters (e.g. `Map<string, T>`). */ 18 + generics( 19 + ...args: ReadonlyArray<string | MaybeTsDsl<TypeOfTsDsl<TypeParamTsDsl>>> 20 + ): this { 21 + this._generics = [...args]; 22 + return this; 23 + } 24 + 25 + /** 26 + * Returns the type parameters as an array of ts.TypeParameterDeclaration nodes. 27 + */ 28 + protected $generics(): 29 + | ReadonlyArray<ts.TypeParameterDeclaration> 30 + | undefined { 31 + return this._generics?.map((g) => { 32 + const node = typeof g === 'string' ? new TypeParamTsDsl(g) : g; 33 + return this.$node(node); 34 + }); 35 + } 36 + 37 + $render(): ts.Node { 38 + throw new Error('noop'); 39 + } 40 + }
+4 -6
packages/openapi-ts/src/ts-dsl/new.ts
··· 6 6 import { AccessMixin } from './mixins/access'; 7 7 import { mixin } from './mixins/apply'; 8 8 import { ArgsMixin } from './mixins/args'; 9 - import { GenericsMixin } from './mixins/generics'; 9 + import { TypeArgsMixin } from './mixins/type-args'; 10 10 11 11 export class NewTsDsl extends TsDsl<ts.NewExpression> { 12 12 private classExpr: MaybeTsDsl<WithString>; ··· 22 22 23 23 /** Builds the `NewExpression` node. */ 24 24 $render(): ts.NewExpression { 25 - const types = this._generics?.map((arg) => this.$type(arg)); 26 25 return ts.factory.createNewExpression( 27 26 this.$node(this.classExpr), 28 - // @ts-expect-error --- generics are not officially supported on 'new' expressions yet 29 - types, 27 + this.$generics(), 30 28 this.$args(), 31 29 ); 32 30 } 33 31 } 34 32 35 - export interface NewTsDsl extends AccessMixin, ArgsMixin, GenericsMixin {} 36 - mixin(NewTsDsl, AccessMixin, ArgsMixin, GenericsMixin); 33 + export interface NewTsDsl extends AccessMixin, ArgsMixin, TypeArgsMixin {} 34 + mixin(NewTsDsl, AccessMixin, ArgsMixin, TypeArgsMixin);
+4 -5
packages/openapi-ts/src/ts-dsl/type/expr.ts
··· 4 4 import type { WithString } from '../base'; 5 5 import { TypeTsDsl } from '../base'; 6 6 import { mixin } from '../mixins/apply'; 7 - import { GenericsMixin } from '../mixins/generics'; 7 + import { TypeArgsMixin } from '../mixins/type-args'; 8 8 import { TypeAttrTsDsl } from './attr'; 9 9 10 10 export class TypeExprTsDsl extends TypeTsDsl<ts.TypeReferenceNode> { ··· 39 39 $render(): ts.TypeReferenceNode { 40 40 if (!this._exprInput) 41 41 throw new Error('TypeExpr must have either an expression or an object'); 42 - const types = this._generics?.map((arg) => this.$type(arg)); 43 42 return ts.factory.createTypeReferenceNode( 44 43 // @ts-expect-error --- need to fix types 45 44 this.$type(this._exprInput), 46 - types, 45 + this.$generics(), 47 46 ); 48 47 } 49 48 } 50 49 51 - export interface TypeExprTsDsl extends GenericsMixin {} 52 - mixin(TypeExprTsDsl, GenericsMixin); 50 + export interface TypeExprTsDsl extends TypeArgsMixin {} 51 + mixin(TypeExprTsDsl, TypeArgsMixin);
+23
packages/openapi-ts/src/ts-dsl/type/query.ts
··· 1 + import ts from 'typescript'; 2 + 3 + import type { MaybeTsDsl, TsDsl } from '../base'; 4 + import { TypeTsDsl } from '../base'; 5 + 6 + export class TypeQueryTsDsl extends TypeTsDsl<ts.TypeQueryNode> { 7 + private expr: string | MaybeTsDsl<TsDsl>; 8 + 9 + constructor(expr: string | MaybeTsDsl<TsDsl>) { 10 + super(); 11 + this.expr = expr; 12 + } 13 + 14 + $render(): ts.TypeQueryNode { 15 + const exprName = this.$node(this.expr); 16 + if (!ts.isEntityName(exprName)) { 17 + throw new Error( 18 + 'TypeQueryTsDsl: expression must resolve to an EntityName', 19 + ); 20 + } 21 + return ts.factory.createTypeQueryNode(exprName); 22 + } 23 + }