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.

Changes before error encountered

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>

+461 -693
+19 -38
examples/openapi-ts-angular-common/src/client/@angular/common.gen.ts
··· 48 48 */ 49 49 export const addPetRequest = <ThrowOnError extends boolean = false>( 50 50 options: Options<AddPetData, ThrowOnError>, 51 - ): HttpRequest<unknown> => 52 - (options?.client ?? client).requestOptions({ 51 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 53 52 method: 'POST', 54 53 responseStyle: 'data', 55 54 url: '/pet', ··· 63 62 */ 64 63 export const updatePetRequest = <ThrowOnError extends boolean = false>( 65 64 options: Options<UpdatePetData, ThrowOnError>, 66 - ): HttpRequest<unknown> => 67 - (options?.client ?? client).requestOptions({ 65 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 68 66 method: 'PUT', 69 67 responseStyle: 'data', 70 68 url: '/pet', ··· 78 76 */ 79 77 export const findPetsByStatusRequest = <ThrowOnError extends boolean = false>( 80 78 options: Options<FindPetsByStatusData, ThrowOnError>, 81 - ): HttpRequest<unknown> => 82 - (options?.client ?? client).requestOptions({ 79 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 83 80 method: 'GET', 84 81 responseStyle: 'data', 85 82 url: '/pet/findByStatus', ··· 93 90 */ 94 91 export const findPetsByTagsRequest = <ThrowOnError extends boolean = false>( 95 92 options: Options<FindPetsByTagsData, ThrowOnError>, 96 - ): HttpRequest<unknown> => 97 - (options?.client ?? client).requestOptions({ 93 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 98 94 method: 'GET', 99 95 responseStyle: 'data', 100 96 url: '/pet/findByTags', ··· 108 104 */ 109 105 export const deletePetRequest = <ThrowOnError extends boolean = false>( 110 106 options: Options<DeletePetData, ThrowOnError>, 111 - ): HttpRequest<unknown> => 112 - (options?.client ?? client).requestOptions({ 107 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 113 108 method: 'DELETE', 114 109 responseStyle: 'data', 115 110 url: '/pet/{petId}', ··· 123 118 */ 124 119 export const getPetByIdRequest = <ThrowOnError extends boolean = false>( 125 120 options: Options<GetPetByIdData, ThrowOnError>, 126 - ): HttpRequest<unknown> => 127 - (options?.client ?? client).requestOptions({ 121 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 128 122 method: 'GET', 129 123 responseStyle: 'data', 130 124 url: '/pet/{petId}', ··· 138 132 */ 139 133 export const updatePetWithFormRequest = <ThrowOnError extends boolean = false>( 140 134 options: Options<UpdatePetWithFormData, ThrowOnError>, 141 - ): HttpRequest<unknown> => 142 - (options?.client ?? client).requestOptions({ 135 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 143 136 method: 'POST', 144 137 responseStyle: 'data', 145 138 url: '/pet/{petId}', ··· 153 146 */ 154 147 export const uploadFileRequest = <ThrowOnError extends boolean = false>( 155 148 options: Options<UploadFileData, ThrowOnError>, 156 - ): HttpRequest<unknown> => 157 - (options?.client ?? client).requestOptions({ 149 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 158 150 method: 'POST', 159 151 responseStyle: 'data', 160 152 url: '/pet/{petId}/uploadImage', ··· 168 160 */ 169 161 export const getInventoryRequest = <ThrowOnError extends boolean = false>( 170 162 options?: Options<GetInventoryData, ThrowOnError>, 171 - ): HttpRequest<unknown> => 172 - (options?.client ?? client).requestOptions({ 163 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 173 164 method: 'GET', 174 165 responseStyle: 'data', 175 166 url: '/store/inventory', ··· 183 174 */ 184 175 export const placeOrderRequest = <ThrowOnError extends boolean = false>( 185 176 options?: Options<PlaceOrderData, ThrowOnError>, 186 - ): HttpRequest<unknown> => 187 - (options?.client ?? client).requestOptions({ 177 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 188 178 method: 'POST', 189 179 responseStyle: 'data', 190 180 url: '/store/order', ··· 198 188 */ 199 189 export const deleteOrderRequest = <ThrowOnError extends boolean = false>( 200 190 options: Options<DeleteOrderData, ThrowOnError>, 201 - ): HttpRequest<unknown> => 202 - (options?.client ?? client).requestOptions({ 191 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 203 192 method: 'DELETE', 204 193 responseStyle: 'data', 205 194 url: '/store/order/{orderId}', ··· 213 202 */ 214 203 export const getOrderByIdRequest = <ThrowOnError extends boolean = false>( 215 204 options: Options<GetOrderByIdData, ThrowOnError>, 216 - ): HttpRequest<unknown> => 217 - (options?.client ?? client).requestOptions({ 205 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 218 206 method: 'GET', 219 207 responseStyle: 'data', 220 208 url: '/store/order/{orderId}', ··· 228 216 */ 229 217 export const createUserRequest = <ThrowOnError extends boolean = false>( 230 218 options?: Options<CreateUserData, ThrowOnError>, 231 - ): HttpRequest<unknown> => 232 - (options?.client ?? client).requestOptions({ 219 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 233 220 method: 'POST', 234 221 responseStyle: 'data', 235 222 url: '/user', ··· 245 232 ThrowOnError extends boolean = false, 246 233 >( 247 234 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 248 - ): HttpRequest<unknown> => 249 - (options?.client ?? client).requestOptions({ 235 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 250 236 method: 'POST', 251 237 responseStyle: 'data', 252 238 url: '/user/createWithList', ··· 260 246 */ 261 247 export const loginUserRequest = <ThrowOnError extends boolean = false>( 262 248 options?: Options<LoginUserData, ThrowOnError>, 263 - ): HttpRequest<unknown> => 264 - (options?.client ?? client).requestOptions({ 249 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 265 250 method: 'GET', 266 251 responseStyle: 'data', 267 252 url: '/user/login', ··· 275 260 */ 276 261 export const logoutUserRequest = <ThrowOnError extends boolean = false>( 277 262 options?: Options<LogoutUserData, ThrowOnError>, 278 - ): HttpRequest<unknown> => 279 - (options?.client ?? client).requestOptions({ 263 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 280 264 method: 'GET', 281 265 responseStyle: 'data', 282 266 url: '/user/logout', ··· 290 274 */ 291 275 export const deleteUserRequest = <ThrowOnError extends boolean = false>( 292 276 options: Options<DeleteUserData, ThrowOnError>, 293 - ): HttpRequest<unknown> => 294 - (options?.client ?? client).requestOptions({ 277 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 295 278 method: 'DELETE', 296 279 responseStyle: 'data', 297 280 url: '/user/{username}', ··· 305 288 */ 306 289 export const getUserByNameRequest = <ThrowOnError extends boolean = false>( 307 290 options: Options<GetUserByNameData, ThrowOnError>, 308 - ): HttpRequest<unknown> => 309 - (options?.client ?? client).requestOptions({ 291 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 310 292 method: 'GET', 311 293 responseStyle: 'data', 312 294 url: '/user/{username}', ··· 320 302 */ 321 303 export const updateUserRequest = <ThrowOnError extends boolean = false>( 322 304 options: Options<UpdateUserData, ThrowOnError>, 323 - ): HttpRequest<unknown> => 324 - (options?.client ?? client).requestOptions({ 305 + ): HttpRequest<unknown> => (options?.client ?? client).requestOptions({ 325 306 method: 'PUT', 326 307 responseStyle: 'data', 327 308 url: '/user/{username}',
+19 -38
examples/openapi-ts-angular-common/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = true>( 88 88 options: Options<AddPetData, ThrowOnError>, 89 - ) => 90 - (options.client ?? client).post< 89 + ) => (options.client ?? client).post< 91 90 AddPetResponses, 92 91 AddPetErrors, 93 92 ThrowOnError, ··· 115 114 */ 116 115 export const updatePet = <ThrowOnError extends boolean = true>( 117 116 options: Options<UpdatePetData, ThrowOnError>, 118 - ) => 119 - (options.client ?? client).put< 117 + ) => (options.client ?? client).put< 120 118 UpdatePetResponses, 121 119 UpdatePetErrors, 122 120 ThrowOnError, ··· 144 142 */ 145 143 export const findPetsByStatus = <ThrowOnError extends boolean = true>( 146 144 options: Options<FindPetsByStatusData, ThrowOnError>, 147 - ) => 148 - (options.client ?? client).get< 145 + ) => (options.client ?? client).get< 149 146 FindPetsByStatusResponses, 150 147 FindPetsByStatusErrors, 151 148 ThrowOnError, ··· 169 166 */ 170 167 export const findPetsByTags = <ThrowOnError extends boolean = true>( 171 168 options: Options<FindPetsByTagsData, ThrowOnError>, 172 - ) => 173 - (options.client ?? client).get< 169 + ) => (options.client ?? client).get< 174 170 FindPetsByTagsResponses, 175 171 FindPetsByTagsErrors, 176 172 ThrowOnError, ··· 194 190 */ 195 191 export const deletePet = <ThrowOnError extends boolean = true>( 196 192 options: Options<DeletePetData, ThrowOnError>, 197 - ) => 198 - (options.client ?? client).delete< 193 + ) => (options.client ?? client).delete< 199 194 DeletePetResponses, 200 195 DeletePetErrors, 201 196 ThrowOnError, ··· 219 214 */ 220 215 export const getPetById = <ThrowOnError extends boolean = true>( 221 216 options: Options<GetPetByIdData, ThrowOnError>, 222 - ) => 223 - (options.client ?? client).get< 217 + ) => (options.client ?? client).get< 224 218 GetPetByIdResponses, 225 219 GetPetByIdErrors, 226 220 ThrowOnError, ··· 248 242 */ 249 243 export const updatePetWithForm = <ThrowOnError extends boolean = true>( 250 244 options: Options<UpdatePetWithFormData, ThrowOnError>, 251 - ) => 252 - (options.client ?? client).post< 245 + ) => (options.client ?? client).post< 253 246 UpdatePetWithFormResponses, 254 247 UpdatePetWithFormErrors, 255 248 ThrowOnError, ··· 273 266 */ 274 267 export const uploadFile = <ThrowOnError extends boolean = true>( 275 268 options: Options<UploadFileData, ThrowOnError>, 276 - ) => 277 - (options.client ?? client).post< 269 + ) => (options.client ?? client).post< 278 270 UploadFileResponses, 279 271 UploadFileErrors, 280 272 ThrowOnError, ··· 303 295 */ 304 296 export const getInventory = <ThrowOnError extends boolean = true>( 305 297 options?: Options<GetInventoryData, ThrowOnError>, 306 - ) => 307 - (options?.client ?? client).get< 298 + ) => (options?.client ?? client).get< 308 299 GetInventoryResponses, 309 300 GetInventoryErrors, 310 301 ThrowOnError, ··· 328 319 */ 329 320 export const placeOrder = <ThrowOnError extends boolean = true>( 330 321 options?: Options<PlaceOrderData, ThrowOnError>, 331 - ) => 332 - (options?.client ?? client).post< 322 + ) => (options?.client ?? client).post< 333 323 PlaceOrderResponses, 334 324 PlaceOrderErrors, 335 325 ThrowOnError, ··· 351 341 */ 352 342 export const deleteOrder = <ThrowOnError extends boolean = true>( 353 343 options: Options<DeleteOrderData, ThrowOnError>, 354 - ) => 355 - (options.client ?? client).delete< 344 + ) => (options.client ?? client).delete< 356 345 DeleteOrderResponses, 357 346 DeleteOrderErrors, 358 347 ThrowOnError, ··· 370 359 */ 371 360 export const getOrderById = <ThrowOnError extends boolean = true>( 372 361 options: Options<GetOrderByIdData, ThrowOnError>, 373 - ) => 374 - (options.client ?? client).get< 362 + ) => (options.client ?? client).get< 375 363 GetOrderByIdResponses, 376 364 GetOrderByIdErrors, 377 365 ThrowOnError, ··· 389 377 */ 390 378 export const createUser = <ThrowOnError extends boolean = true>( 391 379 options?: Options<CreateUserData, ThrowOnError>, 392 - ) => 393 - (options?.client ?? client).post< 380 + ) => (options?.client ?? client).post< 394 381 CreateUserResponses, 395 382 CreateUserErrors, 396 383 ThrowOnError, ··· 412 399 */ 413 400 export const createUsersWithListInput = <ThrowOnError extends boolean = true>( 414 401 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 415 - ) => 416 - (options?.client ?? client).post< 402 + ) => (options?.client ?? client).post< 417 403 CreateUsersWithListInputResponses, 418 404 CreateUsersWithListInputErrors, 419 405 ThrowOnError, ··· 435 421 */ 436 422 export const loginUser = <ThrowOnError extends boolean = true>( 437 423 options?: Options<LoginUserData, ThrowOnError>, 438 - ) => 439 - (options?.client ?? client).get< 424 + ) => (options?.client ?? client).get< 440 425 LoginUserResponses, 441 426 LoginUserErrors, 442 427 ThrowOnError, ··· 454 439 */ 455 440 export const logoutUser = <ThrowOnError extends boolean = true>( 456 441 options?: Options<LogoutUserData, ThrowOnError>, 457 - ) => 458 - (options?.client ?? client).get< 442 + ) => (options?.client ?? client).get< 459 443 LogoutUserResponses, 460 444 LogoutUserErrors, 461 445 ThrowOnError, ··· 473 457 */ 474 458 export const deleteUser = <ThrowOnError extends boolean = true>( 475 459 options: Options<DeleteUserData, ThrowOnError>, 476 - ) => 477 - (options.client ?? client).delete< 460 + ) => (options.client ?? client).delete< 478 461 DeleteUserResponses, 479 462 DeleteUserErrors, 480 463 ThrowOnError, ··· 492 475 */ 493 476 export const getUserByName = <ThrowOnError extends boolean = true>( 494 477 options: Options<GetUserByNameData, ThrowOnError>, 495 - ) => 496 - (options.client ?? client).get< 478 + ) => (options.client ?? client).get< 497 479 GetUserByNameResponses, 498 480 GetUserByNameErrors, 499 481 ThrowOnError, ··· 511 493 */ 512 494 export const updateUser = <ThrowOnError extends boolean = true>( 513 495 options: Options<UpdateUserData, ThrowOnError>, 514 - ) => 515 - (options.client ?? client).put< 496 + ) => (options.client ?? client).put< 516 497 UpdateUserResponses, 517 498 UpdateUserErrors, 518 499 ThrowOnError,
+23 -38
examples/openapi-ts-axios/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError>, 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post< 90 + AddPetResponses, 91 + AddPetErrors, 92 + ThrowOnError 93 + >({ 91 94 responseType: 'json', 92 95 security: [ 93 96 { ··· 110 113 */ 111 114 export const updatePet = <ThrowOnError extends boolean = false>( 112 115 options: Options<UpdatePetData, ThrowOnError>, 113 - ) => 114 - (options.client ?? client).put< 116 + ) => (options.client ?? client).put< 115 117 UpdatePetResponses, 116 118 UpdatePetErrors, 117 119 ThrowOnError ··· 138 140 */ 139 141 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 140 142 options: Options<FindPetsByStatusData, ThrowOnError>, 141 - ) => 142 - (options.client ?? client).get< 143 + ) => (options.client ?? client).get< 143 144 FindPetsByStatusResponses, 144 145 FindPetsByStatusErrors, 145 146 ThrowOnError ··· 162 163 */ 163 164 export const findPetsByTags = <ThrowOnError extends boolean = false>( 164 165 options: Options<FindPetsByTagsData, ThrowOnError>, 165 - ) => 166 - (options.client ?? client).get< 166 + ) => (options.client ?? client).get< 167 167 FindPetsByTagsResponses, 168 168 FindPetsByTagsErrors, 169 169 ThrowOnError ··· 186 186 */ 187 187 export const deletePet = <ThrowOnError extends boolean = false>( 188 188 options: Options<DeletePetData, ThrowOnError>, 189 - ) => 190 - (options.client ?? client).delete< 189 + ) => (options.client ?? client).delete< 191 190 DeletePetResponses, 192 191 DeletePetErrors, 193 192 ThrowOnError ··· 209 208 */ 210 209 export const getPetById = <ThrowOnError extends boolean = false>( 211 210 options: Options<GetPetByIdData, ThrowOnError>, 212 - ) => 213 - (options.client ?? client).get< 211 + ) => (options.client ?? client).get< 214 212 GetPetByIdResponses, 215 213 GetPetByIdErrors, 216 214 ThrowOnError ··· 237 235 */ 238 236 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 239 237 options: Options<UpdatePetWithFormData, ThrowOnError>, 240 - ) => 241 - (options.client ?? client).post< 238 + ) => (options.client ?? client).post< 242 239 UpdatePetWithFormResponses, 243 240 UpdatePetWithFormErrors, 244 241 ThrowOnError ··· 261 258 */ 262 259 export const uploadFile = <ThrowOnError extends boolean = false>( 263 260 options: Options<UploadFileData, ThrowOnError>, 264 - ) => 265 - (options.client ?? client).post< 261 + ) => (options.client ?? client).post< 266 262 UploadFileResponses, 267 263 UploadFileErrors, 268 264 ThrowOnError ··· 290 286 */ 291 287 export const getInventory = <ThrowOnError extends boolean = false>( 292 288 options?: Options<GetInventoryData, ThrowOnError>, 293 - ) => 294 - (options?.client ?? client).get< 289 + ) => (options?.client ?? client).get< 295 290 GetInventoryResponses, 296 291 GetInventoryErrors, 297 292 ThrowOnError ··· 314 309 */ 315 310 export const placeOrder = <ThrowOnError extends boolean = false>( 316 311 options?: Options<PlaceOrderData, ThrowOnError>, 317 - ) => 318 - (options?.client ?? client).post< 312 + ) => (options?.client ?? client).post< 319 313 PlaceOrderResponses, 320 314 PlaceOrderErrors, 321 315 ThrowOnError ··· 336 330 */ 337 331 export const deleteOrder = <ThrowOnError extends boolean = false>( 338 332 options: Options<DeleteOrderData, ThrowOnError>, 339 - ) => 340 - (options.client ?? client).delete< 333 + ) => (options.client ?? client).delete< 341 334 DeleteOrderResponses, 342 335 DeleteOrderErrors, 343 336 ThrowOnError ··· 353 346 */ 354 347 export const getOrderById = <ThrowOnError extends boolean = false>( 355 348 options: Options<GetOrderByIdData, ThrowOnError>, 356 - ) => 357 - (options.client ?? client).get< 349 + ) => (options.client ?? client).get< 358 350 GetOrderByIdResponses, 359 351 GetOrderByIdErrors, 360 352 ThrowOnError ··· 371 363 */ 372 364 export const createUser = <ThrowOnError extends boolean = false>( 373 365 options?: Options<CreateUserData, ThrowOnError>, 374 - ) => 375 - (options?.client ?? client).post< 366 + ) => (options?.client ?? client).post< 376 367 CreateUserResponses, 377 368 CreateUserErrors, 378 369 ThrowOnError ··· 393 384 */ 394 385 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 395 386 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 396 - ) => 397 - (options?.client ?? client).post< 387 + ) => (options?.client ?? client).post< 398 388 CreateUsersWithListInputResponses, 399 389 CreateUsersWithListInputErrors, 400 390 ThrowOnError ··· 415 405 */ 416 406 export const loginUser = <ThrowOnError extends boolean = false>( 417 407 options?: Options<LoginUserData, ThrowOnError>, 418 - ) => 419 - (options?.client ?? client).get< 408 + ) => (options?.client ?? client).get< 420 409 LoginUserResponses, 421 410 LoginUserErrors, 422 411 ThrowOnError ··· 433 422 */ 434 423 export const logoutUser = <ThrowOnError extends boolean = false>( 435 424 options?: Options<LogoutUserData, ThrowOnError>, 436 - ) => 437 - (options?.client ?? client).get< 425 + ) => (options?.client ?? client).get< 438 426 LogoutUserResponses, 439 427 LogoutUserErrors, 440 428 ThrowOnError ··· 450 438 */ 451 439 export const deleteUser = <ThrowOnError extends boolean = false>( 452 440 options: Options<DeleteUserData, ThrowOnError>, 453 - ) => 454 - (options.client ?? client).delete< 441 + ) => (options.client ?? client).delete< 455 442 DeleteUserResponses, 456 443 DeleteUserErrors, 457 444 ThrowOnError ··· 467 454 */ 468 455 export const getUserByName = <ThrowOnError extends boolean = false>( 469 456 options: Options<GetUserByNameData, ThrowOnError>, 470 - ) => 471 - (options.client ?? client).get< 457 + ) => (options.client ?? client).get< 472 458 GetUserByNameResponses, 473 459 GetUserByNameErrors, 474 460 ThrowOnError ··· 485 471 */ 486 472 export const updateUser = <ThrowOnError extends boolean = false>( 487 473 options: Options<UpdateUserData, ThrowOnError>, 488 - ) => 489 - (options.client ?? client).put< 474 + ) => (options.client ?? client).put< 490 475 UpdateUserResponses, 491 476 UpdateUserErrors, 492 477 ThrowOnError
+3 -6
examples/openapi-ts-fastify/src/client/sdk.gen.ts
··· 36 36 */ 37 37 export const listPets = <ThrowOnError extends boolean = false>( 38 38 options?: Options<ListPetsData, ThrowOnError>, 39 - ) => 40 - (options?.client ?? client).get< 39 + ) => (options?.client ?? client).get< 41 40 ListPetsResponses, 42 41 ListPetsErrors, 43 42 ThrowOnError ··· 51 50 */ 52 51 export const createPets = <ThrowOnError extends boolean = false>( 53 52 options?: Options<CreatePetsData, ThrowOnError>, 54 - ) => 55 - (options?.client ?? client).post< 53 + ) => (options?.client ?? client).post< 56 54 CreatePetsResponses, 57 55 CreatePetsErrors, 58 56 ThrowOnError ··· 66 64 */ 67 65 export const showPetById = <ThrowOnError extends boolean = false>( 68 66 options: Options<ShowPetByIdData, ThrowOnError>, 69 - ) => 70 - (options.client ?? client).get< 67 + ) => (options.client ?? client).get< 71 68 ShowPetByIdResponses, 72 69 ShowPetByIdErrors, 73 70 ThrowOnError
+23 -38
examples/openapi-ts-fetch/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError>, 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post< 90 + AddPetResponses, 91 + AddPetErrors, 92 + ThrowOnError 93 + >({ 91 94 security: [ 92 95 { 93 96 scheme: 'bearer', ··· 109 112 */ 110 113 export const updatePet = <ThrowOnError extends boolean = false>( 111 114 options: Options<UpdatePetData, ThrowOnError>, 112 - ) => 113 - (options.client ?? client).put< 115 + ) => (options.client ?? client).put< 114 116 UpdatePetResponses, 115 117 UpdatePetErrors, 116 118 ThrowOnError ··· 136 138 */ 137 139 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 138 140 options: Options<FindPetsByStatusData, ThrowOnError>, 139 - ) => 140 - (options.client ?? client).get< 141 + ) => (options.client ?? client).get< 141 142 FindPetsByStatusResponses, 142 143 FindPetsByStatusErrors, 143 144 ThrowOnError ··· 159 160 */ 160 161 export const findPetsByTags = <ThrowOnError extends boolean = false>( 161 162 options: Options<FindPetsByTagsData, ThrowOnError>, 162 - ) => 163 - (options.client ?? client).get< 163 + ) => (options.client ?? client).get< 164 164 FindPetsByTagsResponses, 165 165 FindPetsByTagsErrors, 166 166 ThrowOnError ··· 182 182 */ 183 183 export const deletePet = <ThrowOnError extends boolean = false>( 184 184 options: Options<DeletePetData, ThrowOnError>, 185 - ) => 186 - (options.client ?? client).delete< 185 + ) => (options.client ?? client).delete< 187 186 DeletePetResponses, 188 187 DeletePetErrors, 189 188 ThrowOnError ··· 205 204 */ 206 205 export const getPetById = <ThrowOnError extends boolean = false>( 207 206 options: Options<GetPetByIdData, ThrowOnError>, 208 - ) => 209 - (options.client ?? client).get< 207 + ) => (options.client ?? client).get< 210 208 GetPetByIdResponses, 211 209 GetPetByIdErrors, 212 210 ThrowOnError ··· 232 230 */ 233 231 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 234 232 options: Options<UpdatePetWithFormData, ThrowOnError>, 235 - ) => 236 - (options.client ?? client).post< 233 + ) => (options.client ?? client).post< 237 234 UpdatePetWithFormResponses, 238 235 UpdatePetWithFormErrors, 239 236 ThrowOnError ··· 255 252 */ 256 253 export const uploadFile = <ThrowOnError extends boolean = false>( 257 254 options: Options<UploadFileData, ThrowOnError>, 258 - ) => 259 - (options.client ?? client).post< 255 + ) => (options.client ?? client).post< 260 256 UploadFileResponses, 261 257 UploadFileErrors, 262 258 ThrowOnError ··· 283 279 */ 284 280 export const getInventory = <ThrowOnError extends boolean = false>( 285 281 options?: Options<GetInventoryData, ThrowOnError>, 286 - ) => 287 - (options?.client ?? client).get< 282 + ) => (options?.client ?? client).get< 288 283 GetInventoryResponses, 289 284 GetInventoryErrors, 290 285 ThrowOnError ··· 306 301 */ 307 302 export const placeOrder = <ThrowOnError extends boolean = false>( 308 303 options?: Options<PlaceOrderData, ThrowOnError>, 309 - ) => 310 - (options?.client ?? client).post< 304 + ) => (options?.client ?? client).post< 311 305 PlaceOrderResponses, 312 306 PlaceOrderErrors, 313 307 ThrowOnError ··· 327 321 */ 328 322 export const deleteOrder = <ThrowOnError extends boolean = false>( 329 323 options: Options<DeleteOrderData, ThrowOnError>, 330 - ) => 331 - (options.client ?? client).delete< 324 + ) => (options.client ?? client).delete< 332 325 DeleteOrderResponses, 333 326 DeleteOrderErrors, 334 327 ThrowOnError ··· 344 337 */ 345 338 export const getOrderById = <ThrowOnError extends boolean = false>( 346 339 options: Options<GetOrderByIdData, ThrowOnError>, 347 - ) => 348 - (options.client ?? client).get< 340 + ) => (options.client ?? client).get< 349 341 GetOrderByIdResponses, 350 342 GetOrderByIdErrors, 351 343 ThrowOnError ··· 361 353 */ 362 354 export const createUser = <ThrowOnError extends boolean = false>( 363 355 options?: Options<CreateUserData, ThrowOnError>, 364 - ) => 365 - (options?.client ?? client).post< 356 + ) => (options?.client ?? client).post< 366 357 CreateUserResponses, 367 358 CreateUserErrors, 368 359 ThrowOnError ··· 382 373 */ 383 374 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 384 375 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 385 - ) => 386 - (options?.client ?? client).post< 376 + ) => (options?.client ?? client).post< 387 377 CreateUsersWithListInputResponses, 388 378 CreateUsersWithListInputErrors, 389 379 ThrowOnError ··· 403 393 */ 404 394 export const loginUser = <ThrowOnError extends boolean = false>( 405 395 options?: Options<LoginUserData, ThrowOnError>, 406 - ) => 407 - (options?.client ?? client).get< 396 + ) => (options?.client ?? client).get< 408 397 LoginUserResponses, 409 398 LoginUserErrors, 410 399 ThrowOnError ··· 420 409 */ 421 410 export const logoutUser = <ThrowOnError extends boolean = false>( 422 411 options?: Options<LogoutUserData, ThrowOnError>, 423 - ) => 424 - (options?.client ?? client).get< 412 + ) => (options?.client ?? client).get< 425 413 LogoutUserResponses, 426 414 LogoutUserErrors, 427 415 ThrowOnError ··· 437 425 */ 438 426 export const deleteUser = <ThrowOnError extends boolean = false>( 439 427 options: Options<DeleteUserData, ThrowOnError>, 440 - ) => 441 - (options.client ?? client).delete< 428 + ) => (options.client ?? client).delete< 442 429 DeleteUserResponses, 443 430 DeleteUserErrors, 444 431 ThrowOnError ··· 454 441 */ 455 442 export const getUserByName = <ThrowOnError extends boolean = false>( 456 443 options: Options<GetUserByNameData, ThrowOnError>, 457 - ) => 458 - (options.client ?? client).get< 444 + ) => (options.client ?? client).get< 459 445 GetUserByNameResponses, 460 446 GetUserByNameErrors, 461 447 ThrowOnError ··· 471 457 */ 472 458 export const updateUser = <ThrowOnError extends boolean = false>( 473 459 options: Options<UpdateUserData, ThrowOnError>, 474 - ) => 475 - (options.client ?? client).put< 460 + ) => (options.client ?? client).put< 476 461 UpdateUserResponses, 477 462 UpdateUserErrors, 478 463 ThrowOnError
+23 -38
examples/openapi-ts-next/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError>, 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post< 90 + AddPetResponses, 91 + AddPetErrors, 92 + ThrowOnError 93 + >({ 91 94 security: [ 92 95 { 93 96 scheme: 'bearer', ··· 109 112 */ 110 113 export const updatePet = <ThrowOnError extends boolean = false>( 111 114 options: Options<UpdatePetData, ThrowOnError>, 112 - ) => 113 - (options.client ?? client).put< 115 + ) => (options.client ?? client).put< 114 116 UpdatePetResponses, 115 117 UpdatePetErrors, 116 118 ThrowOnError ··· 136 138 */ 137 139 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 138 140 options: Options<FindPetsByStatusData, ThrowOnError>, 139 - ) => 140 - (options.client ?? client).get< 141 + ) => (options.client ?? client).get< 141 142 FindPetsByStatusResponses, 142 143 FindPetsByStatusErrors, 143 144 ThrowOnError ··· 159 160 */ 160 161 export const findPetsByTags = <ThrowOnError extends boolean = false>( 161 162 options: Options<FindPetsByTagsData, ThrowOnError>, 162 - ) => 163 - (options.client ?? client).get< 163 + ) => (options.client ?? client).get< 164 164 FindPetsByTagsResponses, 165 165 FindPetsByTagsErrors, 166 166 ThrowOnError ··· 182 182 */ 183 183 export const deletePet = <ThrowOnError extends boolean = false>( 184 184 options: Options<DeletePetData, ThrowOnError>, 185 - ) => 186 - (options.client ?? client).delete< 185 + ) => (options.client ?? client).delete< 187 186 DeletePetResponses, 188 187 DeletePetErrors, 189 188 ThrowOnError ··· 205 204 */ 206 205 export const getPetById = <ThrowOnError extends boolean = false>( 207 206 options: Options<GetPetByIdData, ThrowOnError>, 208 - ) => 209 - (options.client ?? client).get< 207 + ) => (options.client ?? client).get< 210 208 GetPetByIdResponses, 211 209 GetPetByIdErrors, 212 210 ThrowOnError ··· 232 230 */ 233 231 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 234 232 options: Options<UpdatePetWithFormData, ThrowOnError>, 235 - ) => 236 - (options.client ?? client).post< 233 + ) => (options.client ?? client).post< 237 234 UpdatePetWithFormResponses, 238 235 UpdatePetWithFormErrors, 239 236 ThrowOnError ··· 255 252 */ 256 253 export const uploadFile = <ThrowOnError extends boolean = false>( 257 254 options: Options<UploadFileData, ThrowOnError>, 258 - ) => 259 - (options.client ?? client).post< 255 + ) => (options.client ?? client).post< 260 256 UploadFileResponses, 261 257 UploadFileErrors, 262 258 ThrowOnError ··· 283 279 */ 284 280 export const getInventory = <ThrowOnError extends boolean = false>( 285 281 options?: Options<GetInventoryData, ThrowOnError>, 286 - ) => 287 - (options?.client ?? client).get< 282 + ) => (options?.client ?? client).get< 288 283 GetInventoryResponses, 289 284 GetInventoryErrors, 290 285 ThrowOnError ··· 306 301 */ 307 302 export const placeOrder = <ThrowOnError extends boolean = false>( 308 303 options?: Options<PlaceOrderData, ThrowOnError>, 309 - ) => 310 - (options?.client ?? client).post< 304 + ) => (options?.client ?? client).post< 311 305 PlaceOrderResponses, 312 306 PlaceOrderErrors, 313 307 ThrowOnError ··· 327 321 */ 328 322 export const deleteOrder = <ThrowOnError extends boolean = false>( 329 323 options: Options<DeleteOrderData, ThrowOnError>, 330 - ) => 331 - (options.client ?? client).delete< 324 + ) => (options.client ?? client).delete< 332 325 DeleteOrderResponses, 333 326 DeleteOrderErrors, 334 327 ThrowOnError ··· 344 337 */ 345 338 export const getOrderById = <ThrowOnError extends boolean = false>( 346 339 options: Options<GetOrderByIdData, ThrowOnError>, 347 - ) => 348 - (options.client ?? client).get< 340 + ) => (options.client ?? client).get< 349 341 GetOrderByIdResponses, 350 342 GetOrderByIdErrors, 351 343 ThrowOnError ··· 361 353 */ 362 354 export const createUser = <ThrowOnError extends boolean = false>( 363 355 options?: Options<CreateUserData, ThrowOnError>, 364 - ) => 365 - (options?.client ?? client).post< 356 + ) => (options?.client ?? client).post< 366 357 CreateUserResponses, 367 358 CreateUserErrors, 368 359 ThrowOnError ··· 382 373 */ 383 374 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 384 375 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 385 - ) => 386 - (options?.client ?? client).post< 376 + ) => (options?.client ?? client).post< 387 377 CreateUsersWithListInputResponses, 388 378 CreateUsersWithListInputErrors, 389 379 ThrowOnError ··· 403 393 */ 404 394 export const loginUser = <ThrowOnError extends boolean = false>( 405 395 options?: Options<LoginUserData, ThrowOnError>, 406 - ) => 407 - (options?.client ?? client).get< 396 + ) => (options?.client ?? client).get< 408 397 LoginUserResponses, 409 398 LoginUserErrors, 410 399 ThrowOnError ··· 420 409 */ 421 410 export const logoutUser = <ThrowOnError extends boolean = false>( 422 411 options?: Options<LogoutUserData, ThrowOnError>, 423 - ) => 424 - (options?.client ?? client).get< 412 + ) => (options?.client ?? client).get< 425 413 LogoutUserResponses, 426 414 LogoutUserErrors, 427 415 ThrowOnError ··· 437 425 */ 438 426 export const deleteUser = <ThrowOnError extends boolean = false>( 439 427 options: Options<DeleteUserData, ThrowOnError>, 440 - ) => 441 - (options.client ?? client).delete< 428 + ) => (options.client ?? client).delete< 442 429 DeleteUserResponses, 443 430 DeleteUserErrors, 444 431 ThrowOnError ··· 454 441 */ 455 442 export const getUserByName = <ThrowOnError extends boolean = false>( 456 443 options: Options<GetUserByNameData, ThrowOnError>, 457 - ) => 458 - (options.client ?? client).get< 444 + ) => (options.client ?? client).get< 459 445 GetUserByNameResponses, 460 446 GetUserByNameErrors, 461 447 ThrowOnError ··· 471 457 */ 472 458 export const updateUser = <ThrowOnError extends boolean = false>( 473 459 options: Options<UpdateUserData, ThrowOnError>, 474 - ) => 475 - (options.client ?? client).put< 460 + ) => (options.client ?? client).put< 476 461 UpdateUserResponses, 477 462 UpdateUserErrors, 478 463 ThrowOnError
+23 -38
examples/openapi-ts-ofetch/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError>, 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post< 90 + AddPetResponses, 91 + AddPetErrors, 92 + ThrowOnError 93 + >({ 91 94 security: [ 92 95 { 93 96 scheme: 'bearer', ··· 109 112 */ 110 113 export const updatePet = <ThrowOnError extends boolean = false>( 111 114 options: Options<UpdatePetData, ThrowOnError>, 112 - ) => 113 - (options.client ?? client).put< 115 + ) => (options.client ?? client).put< 114 116 UpdatePetResponses, 115 117 UpdatePetErrors, 116 118 ThrowOnError ··· 136 138 */ 137 139 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 138 140 options: Options<FindPetsByStatusData, ThrowOnError>, 139 - ) => 140 - (options.client ?? client).get< 141 + ) => (options.client ?? client).get< 141 142 FindPetsByStatusResponses, 142 143 FindPetsByStatusErrors, 143 144 ThrowOnError ··· 159 160 */ 160 161 export const findPetsByTags = <ThrowOnError extends boolean = false>( 161 162 options: Options<FindPetsByTagsData, ThrowOnError>, 162 - ) => 163 - (options.client ?? client).get< 163 + ) => (options.client ?? client).get< 164 164 FindPetsByTagsResponses, 165 165 FindPetsByTagsErrors, 166 166 ThrowOnError ··· 182 182 */ 183 183 export const deletePet = <ThrowOnError extends boolean = false>( 184 184 options: Options<DeletePetData, ThrowOnError>, 185 - ) => 186 - (options.client ?? client).delete< 185 + ) => (options.client ?? client).delete< 187 186 DeletePetResponses, 188 187 DeletePetErrors, 189 188 ThrowOnError ··· 205 204 */ 206 205 export const getPetById = <ThrowOnError extends boolean = false>( 207 206 options: Options<GetPetByIdData, ThrowOnError>, 208 - ) => 209 - (options.client ?? client).get< 207 + ) => (options.client ?? client).get< 210 208 GetPetByIdResponses, 211 209 GetPetByIdErrors, 212 210 ThrowOnError ··· 232 230 */ 233 231 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 234 232 options: Options<UpdatePetWithFormData, ThrowOnError>, 235 - ) => 236 - (options.client ?? client).post< 233 + ) => (options.client ?? client).post< 237 234 UpdatePetWithFormResponses, 238 235 UpdatePetWithFormErrors, 239 236 ThrowOnError ··· 255 252 */ 256 253 export const uploadFile = <ThrowOnError extends boolean = false>( 257 254 options: Options<UploadFileData, ThrowOnError>, 258 - ) => 259 - (options.client ?? client).post< 255 + ) => (options.client ?? client).post< 260 256 UploadFileResponses, 261 257 UploadFileErrors, 262 258 ThrowOnError ··· 283 279 */ 284 280 export const getInventory = <ThrowOnError extends boolean = false>( 285 281 options?: Options<GetInventoryData, ThrowOnError>, 286 - ) => 287 - (options?.client ?? client).get< 282 + ) => (options?.client ?? client).get< 288 283 GetInventoryResponses, 289 284 GetInventoryErrors, 290 285 ThrowOnError ··· 306 301 */ 307 302 export const placeOrder = <ThrowOnError extends boolean = false>( 308 303 options?: Options<PlaceOrderData, ThrowOnError>, 309 - ) => 310 - (options?.client ?? client).post< 304 + ) => (options?.client ?? client).post< 311 305 PlaceOrderResponses, 312 306 PlaceOrderErrors, 313 307 ThrowOnError ··· 327 321 */ 328 322 export const deleteOrder = <ThrowOnError extends boolean = false>( 329 323 options: Options<DeleteOrderData, ThrowOnError>, 330 - ) => 331 - (options.client ?? client).delete< 324 + ) => (options.client ?? client).delete< 332 325 DeleteOrderResponses, 333 326 DeleteOrderErrors, 334 327 ThrowOnError ··· 344 337 */ 345 338 export const getOrderById = <ThrowOnError extends boolean = false>( 346 339 options: Options<GetOrderByIdData, ThrowOnError>, 347 - ) => 348 - (options.client ?? client).get< 340 + ) => (options.client ?? client).get< 349 341 GetOrderByIdResponses, 350 342 GetOrderByIdErrors, 351 343 ThrowOnError ··· 361 353 */ 362 354 export const createUser = <ThrowOnError extends boolean = false>( 363 355 options?: Options<CreateUserData, ThrowOnError>, 364 - ) => 365 - (options?.client ?? client).post< 356 + ) => (options?.client ?? client).post< 366 357 CreateUserResponses, 367 358 CreateUserErrors, 368 359 ThrowOnError ··· 382 373 */ 383 374 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 384 375 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 385 - ) => 386 - (options?.client ?? client).post< 376 + ) => (options?.client ?? client).post< 387 377 CreateUsersWithListInputResponses, 388 378 CreateUsersWithListInputErrors, 389 379 ThrowOnError ··· 403 393 */ 404 394 export const loginUser = <ThrowOnError extends boolean = false>( 405 395 options?: Options<LoginUserData, ThrowOnError>, 406 - ) => 407 - (options?.client ?? client).get< 396 + ) => (options?.client ?? client).get< 408 397 LoginUserResponses, 409 398 LoginUserErrors, 410 399 ThrowOnError ··· 420 409 */ 421 410 export const logoutUser = <ThrowOnError extends boolean = false>( 422 411 options?: Options<LogoutUserData, ThrowOnError>, 423 - ) => 424 - (options?.client ?? client).get< 412 + ) => (options?.client ?? client).get< 425 413 LogoutUserResponses, 426 414 LogoutUserErrors, 427 415 ThrowOnError ··· 437 425 */ 438 426 export const deleteUser = <ThrowOnError extends boolean = false>( 439 427 options: Options<DeleteUserData, ThrowOnError>, 440 - ) => 441 - (options.client ?? client).delete< 428 + ) => (options.client ?? client).delete< 442 429 DeleteUserResponses, 443 430 DeleteUserErrors, 444 431 ThrowOnError ··· 454 441 */ 455 442 export const getUserByName = <ThrowOnError extends boolean = false>( 456 443 options: Options<GetUserByNameData, ThrowOnError>, 457 - ) => 458 - (options.client ?? client).get< 444 + ) => (options.client ?? client).get< 459 445 GetUserByNameResponses, 460 446 GetUserByNameErrors, 461 447 ThrowOnError ··· 471 457 */ 472 458 export const updateUser = <ThrowOnError extends boolean = false>( 473 459 options: Options<UpdateUserData, ThrowOnError>, 474 - ) => 475 - (options.client ?? client).put< 460 + ) => (options.client ?? client).put< 476 461 UpdateUserResponses, 477 462 UpdateUserErrors, 478 463 ThrowOnError
+99 -99
examples/openapi-ts-pinia-colada/src/client/@pinia/colada.gen.ts
··· 63 63 export const addPetMutation = ( 64 64 options?: Partial<Options<AddPetData>> 65 65 ): UseMutationOptions<AddPetResponse, Options<AddPetData>, Error> => ({ 66 - mutation: async (fnOptions) => { 67 - const { data } = await addPet({ 68 - ...options, 69 - ...fnOptions, 70 - throwOnError: true 71 - }) 72 - return data 73 - } 74 - }) 66 + mutation: async (fnOptions) => { 67 + const { data } = await addPet({ 68 + ...options, 69 + ...fnOptions, 70 + throwOnError: true 71 + }) 72 + return data 73 + } 74 + }) 75 75 76 76 /** 77 77 * Update an existing pet. ··· 81 81 export const updatePetMutation = ( 82 82 options?: Partial<Options<UpdatePetData>> 83 83 ): UseMutationOptions<UpdatePetResponse, Options<UpdatePetData>, Error> => ({ 84 - mutation: async (fnOptions) => { 85 - const { data } = await updatePet({ 86 - ...options, 87 - ...fnOptions, 88 - throwOnError: true 89 - }) 90 - return data 91 - } 92 - }) 84 + mutation: async (fnOptions) => { 85 + const { data } = await updatePet({ 86 + ...options, 87 + ...fnOptions, 88 + throwOnError: true 89 + }) 90 + return data 91 + } 92 + }) 93 93 94 94 export type QueryKey<TOptions extends Options> = [ 95 95 Pick<TOptions, 'path'> & { ··· 175 175 export const deletePetMutation = ( 176 176 options?: Partial<Options<DeletePetData>> 177 177 ): UseMutationOptions<unknown, Options<DeletePetData>, Error> => ({ 178 - mutation: async (fnOptions) => { 179 - const { data } = await deletePet({ 180 - ...options, 181 - ...fnOptions, 182 - throwOnError: true 183 - }) 184 - return data 185 - } 186 - }) 178 + mutation: async (fnOptions) => { 179 + const { data } = await deletePet({ 180 + ...options, 181 + ...fnOptions, 182 + throwOnError: true 183 + }) 184 + return data 185 + } 186 + }) 187 187 188 188 /** 189 189 * Find pet by ID. ··· 210 210 export const updatePetWithFormMutation = ( 211 211 options?: Partial<Options<UpdatePetWithFormData>> 212 212 ): UseMutationOptions<UpdatePetWithFormResponse, Options<UpdatePetWithFormData>, Error> => ({ 213 - mutation: async (fnOptions) => { 214 - const { data } = await updatePetWithForm({ 215 - ...options, 216 - ...fnOptions, 217 - throwOnError: true 218 - }) 219 - return data 220 - } 221 - }) 213 + mutation: async (fnOptions) => { 214 + const { data } = await updatePetWithForm({ 215 + ...options, 216 + ...fnOptions, 217 + throwOnError: true 218 + }) 219 + return data 220 + } 221 + }) 222 222 223 223 /** 224 224 * Uploads an image. ··· 228 228 export const uploadFileMutation = ( 229 229 options?: Partial<Options<UploadFileData>> 230 230 ): UseMutationOptions<UploadFileResponse, Options<UploadFileData>, Error> => ({ 231 - mutation: async (fnOptions) => { 232 - const { data } = await uploadFile({ 233 - ...options, 234 - ...fnOptions, 235 - throwOnError: true 236 - }) 237 - return data 238 - } 239 - }) 231 + mutation: async (fnOptions) => { 232 + const { data } = await uploadFile({ 233 + ...options, 234 + ...fnOptions, 235 + throwOnError: true 236 + }) 237 + return data 238 + } 239 + }) 240 240 241 241 /** 242 242 * Returns pet inventories by status. ··· 263 263 export const placeOrderMutation = ( 264 264 options?: Partial<Options<PlaceOrderData>> 265 265 ): UseMutationOptions<PlaceOrderResponse, Options<PlaceOrderData>, Error> => ({ 266 - mutation: async (fnOptions) => { 267 - const { data } = await placeOrder({ 268 - ...options, 269 - ...fnOptions, 270 - throwOnError: true 271 - }) 272 - return data 273 - } 274 - }) 266 + mutation: async (fnOptions) => { 267 + const { data } = await placeOrder({ 268 + ...options, 269 + ...fnOptions, 270 + throwOnError: true 271 + }) 272 + return data 273 + } 274 + }) 275 275 276 276 /** 277 277 * Delete purchase order by identifier. ··· 281 281 export const deleteOrderMutation = ( 282 282 options?: Partial<Options<DeleteOrderData>> 283 283 ): UseMutationOptions<unknown, Options<DeleteOrderData>, Error> => ({ 284 - mutation: async (fnOptions) => { 285 - const { data } = await deleteOrder({ 286 - ...options, 287 - ...fnOptions, 288 - throwOnError: true 289 - }) 290 - return data 291 - } 292 - }) 284 + mutation: async (fnOptions) => { 285 + const { data } = await deleteOrder({ 286 + ...options, 287 + ...fnOptions, 288 + throwOnError: true 289 + }) 290 + return data 291 + } 292 + }) 293 293 294 294 /** 295 295 * Find purchase order by ID. ··· 316 316 export const createUserMutation = ( 317 317 options?: Partial<Options<CreateUserData>> 318 318 ): UseMutationOptions<CreateUserResponse, Options<CreateUserData>, Error> => ({ 319 - mutation: async (fnOptions) => { 320 - const { data } = await createUser({ 321 - ...options, 322 - ...fnOptions, 323 - throwOnError: true 324 - }) 325 - return data 326 - } 327 - }) 319 + mutation: async (fnOptions) => { 320 + const { data } = await createUser({ 321 + ...options, 322 + ...fnOptions, 323 + throwOnError: true 324 + }) 325 + return data 326 + } 327 + }) 328 328 329 329 /** 330 330 * Creates list of users with given input array. ··· 338 338 Options<CreateUsersWithListInputData>, 339 339 Error 340 340 > => ({ 341 - mutation: async (fnOptions) => { 342 - const { data } = await createUsersWithListInput({ 343 - ...options, 344 - ...fnOptions, 345 - throwOnError: true 346 - }) 347 - return data 348 - } 349 - }) 341 + mutation: async (fnOptions) => { 342 + const { data } = await createUsersWithListInput({ 343 + ...options, 344 + ...fnOptions, 345 + throwOnError: true 346 + }) 347 + return data 348 + } 349 + }) 350 350 351 351 /** 352 352 * Logs user into the system. ··· 390 390 export const deleteUserMutation = ( 391 391 options?: Partial<Options<DeleteUserData>> 392 392 ): UseMutationOptions<unknown, Options<DeleteUserData>, Error> => ({ 393 - mutation: async (fnOptions) => { 394 - const { data } = await deleteUser({ 395 - ...options, 396 - ...fnOptions, 397 - throwOnError: true 398 - }) 399 - return data 400 - } 401 - }) 393 + mutation: async (fnOptions) => { 394 + const { data } = await deleteUser({ 395 + ...options, 396 + ...fnOptions, 397 + throwOnError: true 398 + }) 399 + return data 400 + } 401 + }) 402 402 403 403 /** 404 404 * Get user by user name. ··· 425 425 export const updateUserMutation = ( 426 426 options?: Partial<Options<UpdateUserData>> 427 427 ): UseMutationOptions<unknown, Options<UpdateUserData>, Error> => ({ 428 - mutation: async (fnOptions) => { 429 - const { data } = await updateUser({ 430 - ...options, 431 - ...fnOptions, 432 - throwOnError: true 433 - }) 434 - return data 435 - } 436 - }) 428 + mutation: async (fnOptions) => { 429 + const { data } = await updateUser({ 430 + ...options, 431 + ...fnOptions, 432 + throwOnError: true 433 + }) 434 + return data 435 + } 436 + })
+27 -38
examples/openapi-ts-pinia-colada/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError> 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 91 90 security: [ 92 91 { 93 92 scheme: 'bearer', ··· 109 108 */ 110 109 export const updatePet = <ThrowOnError extends boolean = false>( 111 110 options: Options<UpdatePetData, ThrowOnError> 112 - ) => 113 - (options.client ?? client).put<UpdatePetResponses, UpdatePetErrors, ThrowOnError>({ 111 + ) => (options.client ?? client).put<UpdatePetResponses, UpdatePetErrors, ThrowOnError>({ 114 112 security: [ 115 113 { 116 114 scheme: 'bearer', ··· 132 130 */ 133 131 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 134 132 options: Options<FindPetsByStatusData, ThrowOnError> 135 - ) => 136 - (options.client ?? client).get<FindPetsByStatusResponses, FindPetsByStatusErrors, ThrowOnError>({ 133 + ) => (options.client ?? client).get< 134 + FindPetsByStatusResponses, 135 + FindPetsByStatusErrors, 136 + ThrowOnError 137 + >({ 137 138 security: [ 138 139 { 139 140 scheme: 'bearer', ··· 151 152 */ 152 153 export const findPetsByTags = <ThrowOnError extends boolean = false>( 153 154 options: Options<FindPetsByTagsData, ThrowOnError> 154 - ) => 155 - (options.client ?? client).get<FindPetsByTagsResponses, FindPetsByTagsErrors, ThrowOnError>({ 155 + ) => (options.client ?? client).get< 156 + FindPetsByTagsResponses, 157 + FindPetsByTagsErrors, 158 + ThrowOnError 159 + >({ 156 160 security: [ 157 161 { 158 162 scheme: 'bearer', ··· 170 174 */ 171 175 export const deletePet = <ThrowOnError extends boolean = false>( 172 176 options: Options<DeletePetData, ThrowOnError> 173 - ) => 174 - (options.client ?? client).delete<DeletePetResponses, DeletePetErrors, ThrowOnError>({ 177 + ) => (options.client ?? client).delete<DeletePetResponses, DeletePetErrors, ThrowOnError>({ 175 178 security: [ 176 179 { 177 180 scheme: 'bearer', ··· 189 192 */ 190 193 export const getPetById = <ThrowOnError extends boolean = false>( 191 194 options: Options<GetPetByIdData, ThrowOnError> 192 - ) => 193 - (options.client ?? client).get<GetPetByIdResponses, GetPetByIdErrors, ThrowOnError>({ 195 + ) => (options.client ?? client).get<GetPetByIdResponses, GetPetByIdErrors, ThrowOnError>({ 194 196 security: [ 195 197 { 196 198 name: 'api_key', ··· 212 214 */ 213 215 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 214 216 options: Options<UpdatePetWithFormData, ThrowOnError> 215 - ) => 216 - (options.client ?? client).post< 217 + ) => (options.client ?? client).post< 217 218 UpdatePetWithFormResponses, 218 219 UpdatePetWithFormErrors, 219 220 ThrowOnError ··· 235 236 */ 236 237 export const uploadFile = <ThrowOnError extends boolean = false>( 237 238 options: Options<UploadFileData, ThrowOnError> 238 - ) => 239 - (options.client ?? client).post<UploadFileResponses, UploadFileErrors, ThrowOnError>({ 239 + ) => (options.client ?? client).post<UploadFileResponses, UploadFileErrors, ThrowOnError>({ 240 240 bodySerializer: null, 241 241 security: [ 242 242 { ··· 259 259 */ 260 260 export const getInventory = <ThrowOnError extends boolean = false>( 261 261 options?: Options<GetInventoryData, ThrowOnError> 262 - ) => 263 - (options?.client ?? client).get<GetInventoryResponses, GetInventoryErrors, ThrowOnError>({ 262 + ) => (options?.client ?? client).get<GetInventoryResponses, GetInventoryErrors, ThrowOnError>({ 264 263 security: [ 265 264 { 266 265 name: 'api_key', ··· 278 277 */ 279 278 export const placeOrder = <ThrowOnError extends boolean = false>( 280 279 options?: Options<PlaceOrderData, ThrowOnError> 281 - ) => 282 - (options?.client ?? client).post<PlaceOrderResponses, PlaceOrderErrors, ThrowOnError>({ 280 + ) => (options?.client ?? client).post<PlaceOrderResponses, PlaceOrderErrors, ThrowOnError>({ 283 281 url: '/store/order', 284 282 ...options, 285 283 headers: { ··· 295 293 */ 296 294 export const deleteOrder = <ThrowOnError extends boolean = false>( 297 295 options: Options<DeleteOrderData, ThrowOnError> 298 - ) => 299 - (options.client ?? client).delete<DeleteOrderResponses, DeleteOrderErrors, ThrowOnError>({ 296 + ) => (options.client ?? client).delete<DeleteOrderResponses, DeleteOrderErrors, ThrowOnError>({ 300 297 url: '/store/order/{orderId}', 301 298 ...options 302 299 }) ··· 308 305 */ 309 306 export const getOrderById = <ThrowOnError extends boolean = false>( 310 307 options: Options<GetOrderByIdData, ThrowOnError> 311 - ) => 312 - (options.client ?? client).get<GetOrderByIdResponses, GetOrderByIdErrors, ThrowOnError>({ 308 + ) => (options.client ?? client).get<GetOrderByIdResponses, GetOrderByIdErrors, ThrowOnError>({ 313 309 url: '/store/order/{orderId}', 314 310 ...options 315 311 }) ··· 321 317 */ 322 318 export const createUser = <ThrowOnError extends boolean = false>( 323 319 options?: Options<CreateUserData, ThrowOnError> 324 - ) => 325 - (options?.client ?? client).post<CreateUserResponses, CreateUserErrors, ThrowOnError>({ 320 + ) => (options?.client ?? client).post<CreateUserResponses, CreateUserErrors, ThrowOnError>({ 326 321 url: '/user', 327 322 ...options, 328 323 headers: { ··· 338 333 */ 339 334 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 340 335 options?: Options<CreateUsersWithListInputData, ThrowOnError> 341 - ) => 342 - (options?.client ?? client).post< 336 + ) => (options?.client ?? client).post< 343 337 CreateUsersWithListInputResponses, 344 338 CreateUsersWithListInputErrors, 345 339 ThrowOnError ··· 359 353 */ 360 354 export const loginUser = <ThrowOnError extends boolean = false>( 361 355 options?: Options<LoginUserData, ThrowOnError> 362 - ) => 363 - (options?.client ?? client).get<LoginUserResponses, LoginUserErrors, ThrowOnError>({ 356 + ) => (options?.client ?? client).get<LoginUserResponses, LoginUserErrors, ThrowOnError>({ 364 357 url: '/user/login', 365 358 ...options 366 359 }) ··· 372 365 */ 373 366 export const logoutUser = <ThrowOnError extends boolean = false>( 374 367 options?: Options<LogoutUserData, ThrowOnError> 375 - ) => 376 - (options?.client ?? client).get<LogoutUserResponses, LogoutUserErrors, ThrowOnError>({ 368 + ) => (options?.client ?? client).get<LogoutUserResponses, LogoutUserErrors, ThrowOnError>({ 377 369 url: '/user/logout', 378 370 ...options 379 371 }) ··· 385 377 */ 386 378 export const deleteUser = <ThrowOnError extends boolean = false>( 387 379 options: Options<DeleteUserData, ThrowOnError> 388 - ) => 389 - (options.client ?? client).delete<DeleteUserResponses, DeleteUserErrors, ThrowOnError>({ 380 + ) => (options.client ?? client).delete<DeleteUserResponses, DeleteUserErrors, ThrowOnError>({ 390 381 url: '/user/{username}', 391 382 ...options 392 383 }) ··· 398 389 */ 399 390 export const getUserByName = <ThrowOnError extends boolean = false>( 400 391 options: Options<GetUserByNameData, ThrowOnError> 401 - ) => 402 - (options.client ?? client).get<GetUserByNameResponses, GetUserByNameErrors, ThrowOnError>({ 392 + ) => (options.client ?? client).get<GetUserByNameResponses, GetUserByNameErrors, ThrowOnError>({ 403 393 url: '/user/{username}', 404 394 ...options 405 395 }) ··· 411 401 */ 412 402 export const updateUser = <ThrowOnError extends boolean = false>( 413 403 options: Options<UpdateUserData, ThrowOnError> 414 - ) => 415 - (options.client ?? client).put<UpdateUserResponses, UpdateUserErrors, ThrowOnError>({ 404 + ) => (options.client ?? client).put<UpdateUserResponses, UpdateUserErrors, ThrowOnError>({ 416 405 url: '/user/{username}', 417 406 ...options, 418 407 headers: {
+17 -17
examples/openapi-ts-pinia-colada/src/client/types.gen.ts
··· 5 5 } 6 6 7 7 export type Order = { 8 - complete?: boolean 9 - id?: number 10 - petId?: number 11 - quantity?: number 12 - shipDate?: string 8 + complete?: boolean, 9 + id?: number, 10 + petId?: number, 11 + quantity?: number, 12 + shipDate?: string, 13 13 /** 14 14 * Order Status 15 15 */ ··· 22 22 } 23 23 24 24 export type User = { 25 - email?: string 26 - firstName?: string 27 - id?: number 25 + email?: string, 26 + firstName?: string, 27 + id?: number, 28 28 lastName?: string 29 - password?: string 30 - phone?: string 29 + password?: string, 30 + phone?: string, 31 31 /** 32 32 * User Status 33 33 */ 34 - userStatus?: number 34 + userStatus?: number, 35 35 username?: string 36 36 } 37 37 ··· 41 41 } 42 42 43 43 export type Pet = { 44 - category?: Category 45 - id?: number 46 - name: string 44 + category?: Category, 45 + id?: number, 46 + name: string, 47 47 photoUrls: Array<string> 48 48 /** 49 49 * pet status in the store 50 50 */ 51 - status?: 'available' | 'pending' | 'sold' 51 + status?: 'available' | 'pending' | 'sold', 52 52 tags?: Array<Tag> 53 53 } 54 54 55 55 export type ApiResponse = { 56 56 code?: number 57 - message?: string 57 + message?: string, 58 58 type?: string 59 59 } 60 60 ··· 535 535 /** 536 536 * The password for login in clear text 537 537 */ 538 - password?: string 538 + password?: string, 539 539 /** 540 540 * The user name for login 541 541 */
+40 -72
examples/openapi-ts-sample/src/client/sdk.gen.ts
··· 121 121 */ 122 122 export const addPet = <ThrowOnError extends boolean = false>( 123 123 options: Options<AddPetData, ThrowOnError>, 124 - ) => 125 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 124 + ) => (options.client ?? client).post< 125 + AddPetResponses, 126 + AddPetErrors, 127 + ThrowOnError 128 + >({ 126 129 requestValidator: async (data) => await zAddPetData.parseAsync(data), 127 130 responseValidator: async (data) => await zAddPetResponse.parseAsync(data), 128 131 security: [ ··· 146 149 */ 147 150 export const updatePet = <ThrowOnError extends boolean = false>( 148 151 options: Options<UpdatePetData, ThrowOnError>, 149 - ) => 150 - (options.client ?? client).put< 152 + ) => (options.client ?? client).put< 151 153 UpdatePetResponses, 152 154 UpdatePetErrors, 153 155 ThrowOnError 154 156 >({ 155 157 requestValidator: async (data) => await zUpdatePetData.parseAsync(data), 156 - responseValidator: async (data) => 157 - await zUpdatePetResponse.parseAsync(data), 158 + responseValidator: async (data) => await zUpdatePetResponse.parseAsync(data), 158 159 security: [ 159 160 { 160 161 scheme: 'bearer', ··· 176 177 */ 177 178 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 178 179 options: Options<FindPetsByStatusData, ThrowOnError>, 179 - ) => 180 - (options.client ?? client).get< 180 + ) => (options.client ?? client).get< 181 181 FindPetsByStatusResponses, 182 182 FindPetsByStatusErrors, 183 183 ThrowOnError 184 184 >({ 185 - requestValidator: async (data) => 186 - await zFindPetsByStatusData.parseAsync(data), 187 - responseValidator: async (data) => 188 - await zFindPetsByStatusResponse.parseAsync(data), 185 + requestValidator: async (data) => await zFindPetsByStatusData.parseAsync(data), 186 + responseValidator: async (data) => await zFindPetsByStatusResponse.parseAsync(data), 189 187 security: [ 190 188 { 191 189 scheme: 'bearer', ··· 203 201 */ 204 202 export const findPetsByTags = <ThrowOnError extends boolean = false>( 205 203 options: Options<FindPetsByTagsData, ThrowOnError>, 206 - ) => 207 - (options.client ?? client).get< 204 + ) => (options.client ?? client).get< 208 205 FindPetsByTagsResponses, 209 206 FindPetsByTagsErrors, 210 207 ThrowOnError 211 208 >({ 212 - requestValidator: async (data) => 213 - await zFindPetsByTagsData.parseAsync(data), 214 - responseValidator: async (data) => 215 - await zFindPetsByTagsResponse.parseAsync(data), 209 + requestValidator: async (data) => await zFindPetsByTagsData.parseAsync(data), 210 + responseValidator: async (data) => await zFindPetsByTagsResponse.parseAsync(data), 216 211 security: [ 217 212 { 218 213 scheme: 'bearer', ··· 230 225 */ 231 226 export const deletePet = <ThrowOnError extends boolean = false>( 232 227 options: Options<DeletePetData, ThrowOnError>, 233 - ) => 234 - (options.client ?? client).delete< 228 + ) => (options.client ?? client).delete< 235 229 DeletePetResponses, 236 230 DeletePetErrors, 237 231 ThrowOnError ··· 254 248 */ 255 249 export const getPetById = <ThrowOnError extends boolean = false>( 256 250 options: Options<GetPetByIdData, ThrowOnError>, 257 - ) => 258 - (options.client ?? client).get< 251 + ) => (options.client ?? client).get< 259 252 GetPetByIdResponses, 260 253 GetPetByIdErrors, 261 254 ThrowOnError 262 255 >({ 263 256 requestValidator: async (data) => await zGetPetByIdData.parseAsync(data), 264 - responseValidator: async (data) => 265 - await zGetPetByIdResponse.parseAsync(data), 257 + responseValidator: async (data) => await zGetPetByIdResponse.parseAsync(data), 266 258 security: [ 267 259 { 268 260 name: 'api_key', ··· 284 276 */ 285 277 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 286 278 options: Options<UpdatePetWithFormData, ThrowOnError>, 287 - ) => 288 - (options.client ?? client).post< 279 + ) => (options.client ?? client).post< 289 280 UpdatePetWithFormResponses, 290 281 UpdatePetWithFormErrors, 291 282 ThrowOnError 292 283 >({ 293 - requestValidator: async (data) => 294 - await zUpdatePetWithFormData.parseAsync(data), 295 - responseValidator: async (data) => 296 - await zUpdatePetWithFormResponse.parseAsync(data), 284 + requestValidator: async (data) => await zUpdatePetWithFormData.parseAsync(data), 285 + responseValidator: async (data) => await zUpdatePetWithFormResponse.parseAsync(data), 297 286 security: [ 298 287 { 299 288 scheme: 'bearer', ··· 311 300 */ 312 301 export const uploadFile = <ThrowOnError extends boolean = false>( 313 302 options: Options<UploadFileData, ThrowOnError>, 314 - ) => 315 - (options.client ?? client).post< 303 + ) => (options.client ?? client).post< 316 304 UploadFileResponses, 317 305 UploadFileErrors, 318 306 ThrowOnError 319 307 >({ 320 308 bodySerializer: null, 321 309 requestValidator: async (data) => await zUploadFileData.parseAsync(data), 322 - responseValidator: async (data) => 323 - await zUploadFileResponse.parseAsync(data), 310 + responseValidator: async (data) => await zUploadFileResponse.parseAsync(data), 324 311 security: [ 325 312 { 326 313 scheme: 'bearer', ··· 342 329 */ 343 330 export const getInventory = <ThrowOnError extends boolean = false>( 344 331 options?: Options<GetInventoryData, ThrowOnError>, 345 - ) => 346 - (options?.client ?? client).get< 332 + ) => (options?.client ?? client).get< 347 333 GetInventoryResponses, 348 334 GetInventoryErrors, 349 335 ThrowOnError 350 336 >({ 351 337 requestValidator: async (data) => await zGetInventoryData.parseAsync(data), 352 - responseValidator: async (data) => 353 - await zGetInventoryResponse.parseAsync(data), 338 + responseValidator: async (data) => await zGetInventoryResponse.parseAsync(data), 354 339 security: [ 355 340 { 356 341 name: 'api_key', ··· 368 353 */ 369 354 export const placeOrder = <ThrowOnError extends boolean = false>( 370 355 options?: Options<PlaceOrderData, ThrowOnError>, 371 - ) => 372 - (options?.client ?? client).post< 356 + ) => (options?.client ?? client).post< 373 357 PlaceOrderResponses, 374 358 PlaceOrderErrors, 375 359 ThrowOnError 376 360 >({ 377 361 requestValidator: async (data) => await zPlaceOrderData.parseAsync(data), 378 - responseValidator: async (data) => 379 - await zPlaceOrderResponse.parseAsync(data), 362 + responseValidator: async (data) => await zPlaceOrderResponse.parseAsync(data), 380 363 url: '/store/order', 381 364 ...options, 382 365 headers: { ··· 392 375 */ 393 376 export const deleteOrder = <ThrowOnError extends boolean = false>( 394 377 options: Options<DeleteOrderData, ThrowOnError>, 395 - ) => 396 - (options.client ?? client).delete< 378 + ) => (options.client ?? client).delete< 397 379 DeleteOrderResponses, 398 380 DeleteOrderErrors, 399 381 ThrowOnError ··· 410 392 */ 411 393 export const getOrderById = <ThrowOnError extends boolean = false>( 412 394 options: Options<GetOrderByIdData, ThrowOnError>, 413 - ) => 414 - (options.client ?? client).get< 395 + ) => (options.client ?? client).get< 415 396 GetOrderByIdResponses, 416 397 GetOrderByIdErrors, 417 398 ThrowOnError 418 399 >({ 419 400 requestValidator: async (data) => await zGetOrderByIdData.parseAsync(data), 420 - responseValidator: async (data) => 421 - await zGetOrderByIdResponse.parseAsync(data), 401 + responseValidator: async (data) => await zGetOrderByIdResponse.parseAsync(data), 422 402 url: '/store/order/{orderId}', 423 403 ...options, 424 404 }); ··· 430 410 */ 431 411 export const createUser = <ThrowOnError extends boolean = false>( 432 412 options?: Options<CreateUserData, ThrowOnError>, 433 - ) => 434 - (options?.client ?? client).post< 413 + ) => (options?.client ?? client).post< 435 414 CreateUserResponses, 436 415 CreateUserErrors, 437 416 ThrowOnError 438 417 >({ 439 418 requestValidator: async (data) => await zCreateUserData.parseAsync(data), 440 - responseValidator: async (data) => 441 - await zCreateUserResponse.parseAsync(data), 419 + responseValidator: async (data) => await zCreateUserResponse.parseAsync(data), 442 420 url: '/user', 443 421 ...options, 444 422 headers: { ··· 454 432 */ 455 433 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 456 434 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 457 - ) => 458 - (options?.client ?? client).post< 435 + ) => (options?.client ?? client).post< 459 436 CreateUsersWithListInputResponses, 460 437 CreateUsersWithListInputErrors, 461 438 ThrowOnError 462 439 >({ 463 - requestValidator: async (data) => 464 - await zCreateUsersWithListInputData.parseAsync(data), 465 - responseValidator: async (data) => 466 - await zCreateUsersWithListInputResponse.parseAsync(data), 440 + requestValidator: async (data) => await zCreateUsersWithListInputData.parseAsync(data), 441 + responseValidator: async (data) => await zCreateUsersWithListInputResponse.parseAsync(data), 467 442 url: '/user/createWithList', 468 443 ...options, 469 444 headers: { ··· 479 454 */ 480 455 export const loginUser = <ThrowOnError extends boolean = false>( 481 456 options?: Options<LoginUserData, ThrowOnError>, 482 - ) => 483 - (options?.client ?? client).get< 457 + ) => (options?.client ?? client).get< 484 458 LoginUserResponses, 485 459 LoginUserErrors, 486 460 ThrowOnError 487 461 >({ 488 462 requestValidator: async (data) => await zLoginUserData.parseAsync(data), 489 - responseValidator: async (data) => 490 - await zLoginUserResponse.parseAsync(data), 463 + responseValidator: async (data) => await zLoginUserResponse.parseAsync(data), 491 464 url: '/user/login', 492 465 ...options, 493 466 }); ··· 499 472 */ 500 473 export const logoutUser = <ThrowOnError extends boolean = false>( 501 474 options?: Options<LogoutUserData, ThrowOnError>, 502 - ) => 503 - (options?.client ?? client).get< 475 + ) => (options?.client ?? client).get< 504 476 LogoutUserResponses, 505 477 LogoutUserErrors, 506 478 ThrowOnError ··· 517 489 */ 518 490 export const deleteUser = <ThrowOnError extends boolean = false>( 519 491 options: Options<DeleteUserData, ThrowOnError>, 520 - ) => 521 - (options.client ?? client).delete< 492 + ) => (options.client ?? client).delete< 522 493 DeleteUserResponses, 523 494 DeleteUserErrors, 524 495 ThrowOnError ··· 535 506 */ 536 507 export const getUserByName = <ThrowOnError extends boolean = false>( 537 508 options: Options<GetUserByNameData, ThrowOnError>, 538 - ) => 539 - (options.client ?? client).get< 509 + ) => (options.client ?? client).get< 540 510 GetUserByNameResponses, 541 511 GetUserByNameErrors, 542 512 ThrowOnError 543 513 >({ 544 514 requestValidator: async (data) => await zGetUserByNameData.parseAsync(data), 545 - responseValidator: async (data) => 546 - await zGetUserByNameResponse.parseAsync(data), 515 + responseValidator: async (data) => await zGetUserByNameResponse.parseAsync(data), 547 516 url: '/user/{username}', 548 517 ...options, 549 518 }); ··· 555 524 */ 556 525 export const updateUser = <ThrowOnError extends boolean = false>( 557 526 options: Options<UpdateUserData, ThrowOnError>, 558 - ) => 559 - (options.client ?? client).put< 527 + ) => (options.client ?? client).put< 560 528 UpdateUserResponses, 561 529 UpdateUserErrors, 562 530 ThrowOnError
+8 -16
examples/openapi-ts-tanstack-angular-query-experimental/src/client/@tanstack/angular-query-experimental.gen.ts
··· 159 159 */ 160 160 export const findPetsByStatusOptions = ( 161 161 options: Options<FindPetsByStatusData>, 162 - ) => 163 - queryOptions({ 162 + ) => queryOptions({ 164 163 queryFn: async ({ queryKey, signal }) => { 165 164 const { data } = await findPetsByStatus({ 166 165 ...options, ··· 181 180 * 182 181 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 183 182 */ 184 - export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => 185 - queryOptions({ 183 + export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => queryOptions({ 186 184 queryFn: async ({ queryKey, signal }) => { 187 185 const { data } = await findPetsByTags({ 188 186 ...options, ··· 228 226 * 229 227 * Returns a single pet. 230 228 */ 231 - export const getPetByIdOptions = (options: Options<GetPetByIdData>) => 232 - queryOptions({ 229 + export const getPetByIdOptions = (options: Options<GetPetByIdData>) => queryOptions({ 233 230 queryFn: async ({ queryKey, signal }) => { 234 231 const { data } = await getPetById({ 235 232 ...options, ··· 308 305 * 309 306 * Returns a map of status codes to quantities. 310 307 */ 311 - export const getInventoryOptions = (options?: Options<GetInventoryData>) => 312 - queryOptions({ 308 + export const getInventoryOptions = (options?: Options<GetInventoryData>) => queryOptions({ 313 309 queryFn: async ({ queryKey, signal }) => { 314 310 const { data } = await getInventory({ 315 311 ...options, ··· 384 380 * 385 381 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 386 382 */ 387 - export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => 388 - queryOptions({ 383 + export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => queryOptions({ 389 384 queryFn: async ({ queryKey, signal }) => { 390 385 const { data } = await getOrderById({ 391 386 ...options, ··· 464 459 * 465 460 * Log into the system. 466 461 */ 467 - export const loginUserOptions = (options?: Options<LoginUserData>) => 468 - queryOptions({ 462 + export const loginUserOptions = (options?: Options<LoginUserData>) => queryOptions({ 469 463 queryFn: async ({ queryKey, signal }) => { 470 464 const { data } = await loginUser({ 471 465 ...options, ··· 486 480 * 487 481 * Log user out of the system. 488 482 */ 489 - export const logoutUserOptions = (options?: Options<LogoutUserData>) => 490 - queryOptions({ 483 + export const logoutUserOptions = (options?: Options<LogoutUserData>) => queryOptions({ 491 484 queryFn: async ({ queryKey, signal }) => { 492 485 const { data } = await logoutUser({ 493 486 ...options, ··· 533 526 * 534 527 * Get user detail based on username. 535 528 */ 536 - export const getUserByNameOptions = (options: Options<GetUserByNameData>) => 537 - queryOptions({ 529 + export const getUserByNameOptions = (options: Options<GetUserByNameData>) => queryOptions({ 538 530 queryFn: async ({ queryKey, signal }) => { 539 531 const { data } = await getUserByName({ 540 532 ...options,
+23 -38
examples/openapi-ts-tanstack-angular-query-experimental/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError>, 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post< 90 + AddPetResponses, 91 + AddPetErrors, 92 + ThrowOnError 93 + >({ 91 94 security: [ 92 95 { 93 96 scheme: 'bearer', ··· 109 112 */ 110 113 export const updatePet = <ThrowOnError extends boolean = false>( 111 114 options: Options<UpdatePetData, ThrowOnError>, 112 - ) => 113 - (options.client ?? client).put< 115 + ) => (options.client ?? client).put< 114 116 UpdatePetResponses, 115 117 UpdatePetErrors, 116 118 ThrowOnError ··· 136 138 */ 137 139 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 138 140 options: Options<FindPetsByStatusData, ThrowOnError>, 139 - ) => 140 - (options.client ?? client).get< 141 + ) => (options.client ?? client).get< 141 142 FindPetsByStatusResponses, 142 143 FindPetsByStatusErrors, 143 144 ThrowOnError ··· 159 160 */ 160 161 export const findPetsByTags = <ThrowOnError extends boolean = false>( 161 162 options: Options<FindPetsByTagsData, ThrowOnError>, 162 - ) => 163 - (options.client ?? client).get< 163 + ) => (options.client ?? client).get< 164 164 FindPetsByTagsResponses, 165 165 FindPetsByTagsErrors, 166 166 ThrowOnError ··· 182 182 */ 183 183 export const deletePet = <ThrowOnError extends boolean = false>( 184 184 options: Options<DeletePetData, ThrowOnError>, 185 - ) => 186 - (options.client ?? client).delete< 185 + ) => (options.client ?? client).delete< 187 186 DeletePetResponses, 188 187 DeletePetErrors, 189 188 ThrowOnError ··· 205 204 */ 206 205 export const getPetById = <ThrowOnError extends boolean = false>( 207 206 options: Options<GetPetByIdData, ThrowOnError>, 208 - ) => 209 - (options.client ?? client).get< 207 + ) => (options.client ?? client).get< 210 208 GetPetByIdResponses, 211 209 GetPetByIdErrors, 212 210 ThrowOnError ··· 232 230 */ 233 231 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 234 232 options: Options<UpdatePetWithFormData, ThrowOnError>, 235 - ) => 236 - (options.client ?? client).post< 233 + ) => (options.client ?? client).post< 237 234 UpdatePetWithFormResponses, 238 235 UpdatePetWithFormErrors, 239 236 ThrowOnError ··· 255 252 */ 256 253 export const uploadFile = <ThrowOnError extends boolean = false>( 257 254 options: Options<UploadFileData, ThrowOnError>, 258 - ) => 259 - (options.client ?? client).post< 255 + ) => (options.client ?? client).post< 260 256 UploadFileResponses, 261 257 UploadFileErrors, 262 258 ThrowOnError ··· 283 279 */ 284 280 export const getInventory = <ThrowOnError extends boolean = false>( 285 281 options?: Options<GetInventoryData, ThrowOnError>, 286 - ) => 287 - (options?.client ?? client).get< 282 + ) => (options?.client ?? client).get< 288 283 GetInventoryResponses, 289 284 GetInventoryErrors, 290 285 ThrowOnError ··· 306 301 */ 307 302 export const placeOrder = <ThrowOnError extends boolean = false>( 308 303 options?: Options<PlaceOrderData, ThrowOnError>, 309 - ) => 310 - (options?.client ?? client).post< 304 + ) => (options?.client ?? client).post< 311 305 PlaceOrderResponses, 312 306 PlaceOrderErrors, 313 307 ThrowOnError ··· 327 321 */ 328 322 export const deleteOrder = <ThrowOnError extends boolean = false>( 329 323 options: Options<DeleteOrderData, ThrowOnError>, 330 - ) => 331 - (options.client ?? client).delete< 324 + ) => (options.client ?? client).delete< 332 325 DeleteOrderResponses, 333 326 DeleteOrderErrors, 334 327 ThrowOnError ··· 344 337 */ 345 338 export const getOrderById = <ThrowOnError extends boolean = false>( 346 339 options: Options<GetOrderByIdData, ThrowOnError>, 347 - ) => 348 - (options.client ?? client).get< 340 + ) => (options.client ?? client).get< 349 341 GetOrderByIdResponses, 350 342 GetOrderByIdErrors, 351 343 ThrowOnError ··· 361 353 */ 362 354 export const createUser = <ThrowOnError extends boolean = false>( 363 355 options?: Options<CreateUserData, ThrowOnError>, 364 - ) => 365 - (options?.client ?? client).post< 356 + ) => (options?.client ?? client).post< 366 357 CreateUserResponses, 367 358 CreateUserErrors, 368 359 ThrowOnError ··· 382 373 */ 383 374 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 384 375 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 385 - ) => 386 - (options?.client ?? client).post< 376 + ) => (options?.client ?? client).post< 387 377 CreateUsersWithListInputResponses, 388 378 CreateUsersWithListInputErrors, 389 379 ThrowOnError ··· 403 393 */ 404 394 export const loginUser = <ThrowOnError extends boolean = false>( 405 395 options?: Options<LoginUserData, ThrowOnError>, 406 - ) => 407 - (options?.client ?? client).get< 396 + ) => (options?.client ?? client).get< 408 397 LoginUserResponses, 409 398 LoginUserErrors, 410 399 ThrowOnError ··· 420 409 */ 421 410 export const logoutUser = <ThrowOnError extends boolean = false>( 422 411 options?: Options<LogoutUserData, ThrowOnError>, 423 - ) => 424 - (options?.client ?? client).get< 412 + ) => (options?.client ?? client).get< 425 413 LogoutUserResponses, 426 414 LogoutUserErrors, 427 415 ThrowOnError ··· 437 425 */ 438 426 export const deleteUser = <ThrowOnError extends boolean = false>( 439 427 options: Options<DeleteUserData, ThrowOnError>, 440 - ) => 441 - (options.client ?? client).delete< 428 + ) => (options.client ?? client).delete< 442 429 DeleteUserResponses, 443 430 DeleteUserErrors, 444 431 ThrowOnError ··· 454 441 */ 455 442 export const getUserByName = <ThrowOnError extends boolean = false>( 456 443 options: Options<GetUserByNameData, ThrowOnError>, 457 - ) => 458 - (options.client ?? client).get< 444 + ) => (options.client ?? client).get< 459 445 GetUserByNameResponses, 460 446 GetUserByNameErrors, 461 447 ThrowOnError ··· 471 457 */ 472 458 export const updateUser = <ThrowOnError extends boolean = false>( 473 459 options: Options<UpdateUserData, ThrowOnError>, 474 - ) => 475 - (options.client ?? client).put< 460 + ) => (options.client ?? client).put< 476 461 UpdateUserResponses, 477 462 UpdateUserErrors, 478 463 ThrowOnError
+8 -16
examples/openapi-ts-tanstack-react-query/src/client/@tanstack/react-query.gen.ts
··· 163 163 */ 164 164 export const findPetsByStatusOptions = ( 165 165 options: Options<FindPetsByStatusData>, 166 - ) => 167 - queryOptions({ 166 + ) => queryOptions({ 168 167 queryFn: async ({ queryKey, signal }) => { 169 168 const { data } = await findPetsByStatus({ 170 169 ...options, ··· 185 184 * 186 185 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 187 186 */ 188 - export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => 189 - queryOptions({ 187 + export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => queryOptions({ 190 188 queryFn: async ({ queryKey, signal }) => { 191 189 const { data } = await findPetsByTags({ 192 190 ...options, ··· 232 230 * 233 231 * Returns a single pet. 234 232 */ 235 - export const getPetByIdOptions = (options: Options<GetPetByIdData>) => 236 - queryOptions({ 233 + export const getPetByIdOptions = (options: Options<GetPetByIdData>) => queryOptions({ 237 234 queryFn: async ({ queryKey, signal }) => { 238 235 const { data } = await getPetById({ 239 236 ...options, ··· 312 309 * 313 310 * Returns a map of status codes to quantities. 314 311 */ 315 - export const getInventoryOptions = (options?: Options<GetInventoryData>) => 316 - queryOptions({ 312 + export const getInventoryOptions = (options?: Options<GetInventoryData>) => queryOptions({ 317 313 queryFn: async ({ queryKey, signal }) => { 318 314 const { data } = await getInventory({ 319 315 ...options, ··· 388 384 * 389 385 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 390 386 */ 391 - export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => 392 - queryOptions({ 387 + export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => queryOptions({ 393 388 queryFn: async ({ queryKey, signal }) => { 394 389 const { data } = await getOrderById({ 395 390 ...options, ··· 468 463 * 469 464 * Log into the system. 470 465 */ 471 - export const loginUserOptions = (options?: Options<LoginUserData>) => 472 - queryOptions({ 466 + export const loginUserOptions = (options?: Options<LoginUserData>) => queryOptions({ 473 467 queryFn: async ({ queryKey, signal }) => { 474 468 const { data } = await loginUser({ 475 469 ...options, ··· 490 484 * 491 485 * Log user out of the system. 492 486 */ 493 - export const logoutUserOptions = (options?: Options<LogoutUserData>) => 494 - queryOptions({ 487 + export const logoutUserOptions = (options?: Options<LogoutUserData>) => queryOptions({ 495 488 queryFn: async ({ queryKey, signal }) => { 496 489 const { data } = await logoutUser({ 497 490 ...options, ··· 537 530 * 538 531 * Get user detail based on username. 539 532 */ 540 - export const getUserByNameOptions = (options: Options<GetUserByNameData>) => 541 - queryOptions({ 533 + export const getUserByNameOptions = (options: Options<GetUserByNameData>) => queryOptions({ 542 534 queryFn: async ({ queryKey, signal }) => { 543 535 const { data } = await getUserByName({ 544 536 ...options,
+23 -38
examples/openapi-ts-tanstack-react-query/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError>, 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post< 90 + AddPetResponses, 91 + AddPetErrors, 92 + ThrowOnError 93 + >({ 91 94 security: [ 92 95 { 93 96 scheme: 'bearer', ··· 109 112 */ 110 113 export const updatePet = <ThrowOnError extends boolean = false>( 111 114 options: Options<UpdatePetData, ThrowOnError>, 112 - ) => 113 - (options.client ?? client).put< 115 + ) => (options.client ?? client).put< 114 116 UpdatePetResponses, 115 117 UpdatePetErrors, 116 118 ThrowOnError ··· 136 138 */ 137 139 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 138 140 options: Options<FindPetsByStatusData, ThrowOnError>, 139 - ) => 140 - (options.client ?? client).get< 141 + ) => (options.client ?? client).get< 141 142 FindPetsByStatusResponses, 142 143 FindPetsByStatusErrors, 143 144 ThrowOnError ··· 159 160 */ 160 161 export const findPetsByTags = <ThrowOnError extends boolean = false>( 161 162 options: Options<FindPetsByTagsData, ThrowOnError>, 162 - ) => 163 - (options.client ?? client).get< 163 + ) => (options.client ?? client).get< 164 164 FindPetsByTagsResponses, 165 165 FindPetsByTagsErrors, 166 166 ThrowOnError ··· 182 182 */ 183 183 export const deletePet = <ThrowOnError extends boolean = false>( 184 184 options: Options<DeletePetData, ThrowOnError>, 185 - ) => 186 - (options.client ?? client).delete< 185 + ) => (options.client ?? client).delete< 187 186 DeletePetResponses, 188 187 DeletePetErrors, 189 188 ThrowOnError ··· 205 204 */ 206 205 export const getPetById = <ThrowOnError extends boolean = false>( 207 206 options: Options<GetPetByIdData, ThrowOnError>, 208 - ) => 209 - (options.client ?? client).get< 207 + ) => (options.client ?? client).get< 210 208 GetPetByIdResponses, 211 209 GetPetByIdErrors, 212 210 ThrowOnError ··· 232 230 */ 233 231 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 234 232 options: Options<UpdatePetWithFormData, ThrowOnError>, 235 - ) => 236 - (options.client ?? client).post< 233 + ) => (options.client ?? client).post< 237 234 UpdatePetWithFormResponses, 238 235 UpdatePetWithFormErrors, 239 236 ThrowOnError ··· 255 252 */ 256 253 export const uploadFile = <ThrowOnError extends boolean = false>( 257 254 options: Options<UploadFileData, ThrowOnError>, 258 - ) => 259 - (options.client ?? client).post< 255 + ) => (options.client ?? client).post< 260 256 UploadFileResponses, 261 257 UploadFileErrors, 262 258 ThrowOnError ··· 283 279 */ 284 280 export const getInventory = <ThrowOnError extends boolean = false>( 285 281 options?: Options<GetInventoryData, ThrowOnError>, 286 - ) => 287 - (options?.client ?? client).get< 282 + ) => (options?.client ?? client).get< 288 283 GetInventoryResponses, 289 284 GetInventoryErrors, 290 285 ThrowOnError ··· 306 301 */ 307 302 export const placeOrder = <ThrowOnError extends boolean = false>( 308 303 options?: Options<PlaceOrderData, ThrowOnError>, 309 - ) => 310 - (options?.client ?? client).post< 304 + ) => (options?.client ?? client).post< 311 305 PlaceOrderResponses, 312 306 PlaceOrderErrors, 313 307 ThrowOnError ··· 327 321 */ 328 322 export const deleteOrder = <ThrowOnError extends boolean = false>( 329 323 options: Options<DeleteOrderData, ThrowOnError>, 330 - ) => 331 - (options.client ?? client).delete< 324 + ) => (options.client ?? client).delete< 332 325 DeleteOrderResponses, 333 326 DeleteOrderErrors, 334 327 ThrowOnError ··· 344 337 */ 345 338 export const getOrderById = <ThrowOnError extends boolean = false>( 346 339 options: Options<GetOrderByIdData, ThrowOnError>, 347 - ) => 348 - (options.client ?? client).get< 340 + ) => (options.client ?? client).get< 349 341 GetOrderByIdResponses, 350 342 GetOrderByIdErrors, 351 343 ThrowOnError ··· 361 353 */ 362 354 export const createUser = <ThrowOnError extends boolean = false>( 363 355 options?: Options<CreateUserData, ThrowOnError>, 364 - ) => 365 - (options?.client ?? client).post< 356 + ) => (options?.client ?? client).post< 366 357 CreateUserResponses, 367 358 CreateUserErrors, 368 359 ThrowOnError ··· 382 373 */ 383 374 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 384 375 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 385 - ) => 386 - (options?.client ?? client).post< 376 + ) => (options?.client ?? client).post< 387 377 CreateUsersWithListInputResponses, 388 378 CreateUsersWithListInputErrors, 389 379 ThrowOnError ··· 403 393 */ 404 394 export const loginUser = <ThrowOnError extends boolean = false>( 405 395 options?: Options<LoginUserData, ThrowOnError>, 406 - ) => 407 - (options?.client ?? client).get< 396 + ) => (options?.client ?? client).get< 408 397 LoginUserResponses, 409 398 LoginUserErrors, 410 399 ThrowOnError ··· 420 409 */ 421 410 export const logoutUser = <ThrowOnError extends boolean = false>( 422 411 options?: Options<LogoutUserData, ThrowOnError>, 423 - ) => 424 - (options?.client ?? client).get< 412 + ) => (options?.client ?? client).get< 425 413 LogoutUserResponses, 426 414 LogoutUserErrors, 427 415 ThrowOnError ··· 437 425 */ 438 426 export const deleteUser = <ThrowOnError extends boolean = false>( 439 427 options: Options<DeleteUserData, ThrowOnError>, 440 - ) => 441 - (options.client ?? client).delete< 428 + ) => (options.client ?? client).delete< 442 429 DeleteUserResponses, 443 430 DeleteUserErrors, 444 431 ThrowOnError ··· 454 441 */ 455 442 export const getUserByName = <ThrowOnError extends boolean = false>( 456 443 options: Options<GetUserByNameData, ThrowOnError>, 457 - ) => 458 - (options.client ?? client).get< 444 + ) => (options.client ?? client).get< 459 445 GetUserByNameResponses, 460 446 GetUserByNameErrors, 461 447 ThrowOnError ··· 471 457 */ 472 458 export const updateUser = <ThrowOnError extends boolean = false>( 473 459 options: Options<UpdateUserData, ThrowOnError>, 474 - ) => 475 - (options.client ?? client).put< 460 + ) => (options.client ?? client).put< 476 461 UpdateUserResponses, 477 462 UpdateUserErrors, 478 463 ThrowOnError
+8 -16
examples/openapi-ts-tanstack-svelte-query/src/client/@tanstack/svelte-query.gen.ts
··· 159 159 */ 160 160 export const findPetsByStatusOptions = ( 161 161 options: Options<FindPetsByStatusData>, 162 - ) => 163 - queryOptions({ 162 + ) => queryOptions({ 164 163 queryFn: async ({ queryKey, signal }) => { 165 164 const { data } = await findPetsByStatus({ 166 165 ...options, ··· 181 180 * 182 181 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 183 182 */ 184 - export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => 185 - queryOptions({ 183 + export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => queryOptions({ 186 184 queryFn: async ({ queryKey, signal }) => { 187 185 const { data } = await findPetsByTags({ 188 186 ...options, ··· 228 226 * 229 227 * Returns a single pet. 230 228 */ 231 - export const getPetByIdOptions = (options: Options<GetPetByIdData>) => 232 - queryOptions({ 229 + export const getPetByIdOptions = (options: Options<GetPetByIdData>) => queryOptions({ 233 230 queryFn: async ({ queryKey, signal }) => { 234 231 const { data } = await getPetById({ 235 232 ...options, ··· 308 305 * 309 306 * Returns a map of status codes to quantities. 310 307 */ 311 - export const getInventoryOptions = (options?: Options<GetInventoryData>) => 312 - queryOptions({ 308 + export const getInventoryOptions = (options?: Options<GetInventoryData>) => queryOptions({ 313 309 queryFn: async ({ queryKey, signal }) => { 314 310 const { data } = await getInventory({ 315 311 ...options, ··· 384 380 * 385 381 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 386 382 */ 387 - export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => 388 - queryOptions({ 383 + export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => queryOptions({ 389 384 queryFn: async ({ queryKey, signal }) => { 390 385 const { data } = await getOrderById({ 391 386 ...options, ··· 464 459 * 465 460 * Log into the system. 466 461 */ 467 - export const loginUserOptions = (options?: Options<LoginUserData>) => 468 - queryOptions({ 462 + export const loginUserOptions = (options?: Options<LoginUserData>) => queryOptions({ 469 463 queryFn: async ({ queryKey, signal }) => { 470 464 const { data } = await loginUser({ 471 465 ...options, ··· 486 480 * 487 481 * Log user out of the system. 488 482 */ 489 - export const logoutUserOptions = (options?: Options<LogoutUserData>) => 490 - queryOptions({ 483 + export const logoutUserOptions = (options?: Options<LogoutUserData>) => queryOptions({ 491 484 queryFn: async ({ queryKey, signal }) => { 492 485 const { data } = await logoutUser({ 493 486 ...options, ··· 533 526 * 534 527 * Get user detail based on username. 535 528 */ 536 - export const getUserByNameOptions = (options: Options<GetUserByNameData>) => 537 - queryOptions({ 529 + export const getUserByNameOptions = (options: Options<GetUserByNameData>) => queryOptions({ 538 530 queryFn: async ({ queryKey, signal }) => { 539 531 const { data } = await getUserByName({ 540 532 ...options,
+23 -38
examples/openapi-ts-tanstack-svelte-query/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError>, 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post< 90 + AddPetResponses, 91 + AddPetErrors, 92 + ThrowOnError 93 + >({ 91 94 security: [ 92 95 { 93 96 scheme: 'bearer', ··· 109 112 */ 110 113 export const updatePet = <ThrowOnError extends boolean = false>( 111 114 options: Options<UpdatePetData, ThrowOnError>, 112 - ) => 113 - (options.client ?? client).put< 115 + ) => (options.client ?? client).put< 114 116 UpdatePetResponses, 115 117 UpdatePetErrors, 116 118 ThrowOnError ··· 136 138 */ 137 139 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 138 140 options: Options<FindPetsByStatusData, ThrowOnError>, 139 - ) => 140 - (options.client ?? client).get< 141 + ) => (options.client ?? client).get< 141 142 FindPetsByStatusResponses, 142 143 FindPetsByStatusErrors, 143 144 ThrowOnError ··· 159 160 */ 160 161 export const findPetsByTags = <ThrowOnError extends boolean = false>( 161 162 options: Options<FindPetsByTagsData, ThrowOnError>, 162 - ) => 163 - (options.client ?? client).get< 163 + ) => (options.client ?? client).get< 164 164 FindPetsByTagsResponses, 165 165 FindPetsByTagsErrors, 166 166 ThrowOnError ··· 182 182 */ 183 183 export const deletePet = <ThrowOnError extends boolean = false>( 184 184 options: Options<DeletePetData, ThrowOnError>, 185 - ) => 186 - (options.client ?? client).delete< 185 + ) => (options.client ?? client).delete< 187 186 DeletePetResponses, 188 187 DeletePetErrors, 189 188 ThrowOnError ··· 205 204 */ 206 205 export const getPetById = <ThrowOnError extends boolean = false>( 207 206 options: Options<GetPetByIdData, ThrowOnError>, 208 - ) => 209 - (options.client ?? client).get< 207 + ) => (options.client ?? client).get< 210 208 GetPetByIdResponses, 211 209 GetPetByIdErrors, 212 210 ThrowOnError ··· 232 230 */ 233 231 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 234 232 options: Options<UpdatePetWithFormData, ThrowOnError>, 235 - ) => 236 - (options.client ?? client).post< 233 + ) => (options.client ?? client).post< 237 234 UpdatePetWithFormResponses, 238 235 UpdatePetWithFormErrors, 239 236 ThrowOnError ··· 255 252 */ 256 253 export const uploadFile = <ThrowOnError extends boolean = false>( 257 254 options: Options<UploadFileData, ThrowOnError>, 258 - ) => 259 - (options.client ?? client).post< 255 + ) => (options.client ?? client).post< 260 256 UploadFileResponses, 261 257 UploadFileErrors, 262 258 ThrowOnError ··· 283 279 */ 284 280 export const getInventory = <ThrowOnError extends boolean = false>( 285 281 options?: Options<GetInventoryData, ThrowOnError>, 286 - ) => 287 - (options?.client ?? client).get< 282 + ) => (options?.client ?? client).get< 288 283 GetInventoryResponses, 289 284 GetInventoryErrors, 290 285 ThrowOnError ··· 306 301 */ 307 302 export const placeOrder = <ThrowOnError extends boolean = false>( 308 303 options?: Options<PlaceOrderData, ThrowOnError>, 309 - ) => 310 - (options?.client ?? client).post< 304 + ) => (options?.client ?? client).post< 311 305 PlaceOrderResponses, 312 306 PlaceOrderErrors, 313 307 ThrowOnError ··· 327 321 */ 328 322 export const deleteOrder = <ThrowOnError extends boolean = false>( 329 323 options: Options<DeleteOrderData, ThrowOnError>, 330 - ) => 331 - (options.client ?? client).delete< 324 + ) => (options.client ?? client).delete< 332 325 DeleteOrderResponses, 333 326 DeleteOrderErrors, 334 327 ThrowOnError ··· 344 337 */ 345 338 export const getOrderById = <ThrowOnError extends boolean = false>( 346 339 options: Options<GetOrderByIdData, ThrowOnError>, 347 - ) => 348 - (options.client ?? client).get< 340 + ) => (options.client ?? client).get< 349 341 GetOrderByIdResponses, 350 342 GetOrderByIdErrors, 351 343 ThrowOnError ··· 361 353 */ 362 354 export const createUser = <ThrowOnError extends boolean = false>( 363 355 options?: Options<CreateUserData, ThrowOnError>, 364 - ) => 365 - (options?.client ?? client).post< 356 + ) => (options?.client ?? client).post< 366 357 CreateUserResponses, 367 358 CreateUserErrors, 368 359 ThrowOnError ··· 382 373 */ 383 374 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 384 375 options?: Options<CreateUsersWithListInputData, ThrowOnError>, 385 - ) => 386 - (options?.client ?? client).post< 376 + ) => (options?.client ?? client).post< 387 377 CreateUsersWithListInputResponses, 388 378 CreateUsersWithListInputErrors, 389 379 ThrowOnError ··· 403 393 */ 404 394 export const loginUser = <ThrowOnError extends boolean = false>( 405 395 options?: Options<LoginUserData, ThrowOnError>, 406 - ) => 407 - (options?.client ?? client).get< 396 + ) => (options?.client ?? client).get< 408 397 LoginUserResponses, 409 398 LoginUserErrors, 410 399 ThrowOnError ··· 420 409 */ 421 410 export const logoutUser = <ThrowOnError extends boolean = false>( 422 411 options?: Options<LogoutUserData, ThrowOnError>, 423 - ) => 424 - (options?.client ?? client).get< 412 + ) => (options?.client ?? client).get< 425 413 LogoutUserResponses, 426 414 LogoutUserErrors, 427 415 ThrowOnError ··· 437 425 */ 438 426 export const deleteUser = <ThrowOnError extends boolean = false>( 439 427 options: Options<DeleteUserData, ThrowOnError>, 440 - ) => 441 - (options.client ?? client).delete< 428 + ) => (options.client ?? client).delete< 442 429 DeleteUserResponses, 443 430 DeleteUserErrors, 444 431 ThrowOnError ··· 454 441 */ 455 442 export const getUserByName = <ThrowOnError extends boolean = false>( 456 443 options: Options<GetUserByNameData, ThrowOnError>, 457 - ) => 458 - (options.client ?? client).get< 444 + ) => (options.client ?? client).get< 459 445 GetUserByNameResponses, 460 446 GetUserByNameErrors, 461 447 ThrowOnError ··· 471 457 */ 472 458 export const updateUser = <ThrowOnError extends boolean = false>( 473 459 options: Options<UpdateUserData, ThrowOnError>, 474 - ) => 475 - (options.client ?? client).put< 460 + ) => (options.client ?? client).put< 476 461 UpdateUserResponses, 477 462 UpdateUserErrors, 478 463 ThrowOnError
+8 -16
examples/openapi-ts-tanstack-vue-query/src/client/@tanstack/vue-query.gen.ts
··· 147 147 * 148 148 * Multiple status values can be provided with comma separated strings. 149 149 */ 150 - export const findPetsByStatusOptions = (options: Options<FindPetsByStatusData>) => 151 - queryOptions({ 150 + export const findPetsByStatusOptions = (options: Options<FindPetsByStatusData>) => queryOptions({ 152 151 queryFn: async ({ queryKey, signal }) => { 153 152 const { data } = await findPetsByStatus({ 154 153 ...options, ··· 169 168 * 170 169 * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 171 170 */ 172 - export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => 173 - queryOptions({ 171 + export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) => queryOptions({ 174 172 queryFn: async ({ queryKey, signal }) => { 175 173 const { data } = await findPetsByTags({ 176 174 ...options, ··· 212 210 * 213 211 * Returns a single pet. 214 212 */ 215 - export const getPetByIdOptions = (options: Options<GetPetByIdData>) => 216 - queryOptions({ 213 + export const getPetByIdOptions = (options: Options<GetPetByIdData>) => queryOptions({ 217 214 queryFn: async ({ queryKey, signal }) => { 218 215 const { data } = await getPetById({ 219 216 ...options, ··· 284 281 * 285 282 * Returns a map of status codes to quantities. 286 283 */ 287 - export const getInventoryOptions = (options?: Options<GetInventoryData>) => 288 - queryOptions({ 284 + export const getInventoryOptions = (options?: Options<GetInventoryData>) => queryOptions({ 289 285 queryFn: async ({ queryKey, signal }) => { 290 286 const { data } = await getInventory({ 291 287 ...options, ··· 352 348 * 353 349 * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 354 350 */ 355 - export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => 356 - queryOptions({ 351 + export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) => queryOptions({ 357 352 queryFn: async ({ queryKey, signal }) => { 358 353 const { data } = await getOrderById({ 359 354 ...options, ··· 428 423 * 429 424 * Log into the system. 430 425 */ 431 - export const loginUserOptions = (options?: Options<LoginUserData>) => 432 - queryOptions({ 426 + export const loginUserOptions = (options?: Options<LoginUserData>) => queryOptions({ 433 427 queryFn: async ({ queryKey, signal }) => { 434 428 const { data } = await loginUser({ 435 429 ...options, ··· 450 444 * 451 445 * Log user out of the system. 452 446 */ 453 - export const logoutUserOptions = (options?: Options<LogoutUserData>) => 454 - queryOptions({ 447 + export const logoutUserOptions = (options?: Options<LogoutUserData>) => queryOptions({ 455 448 queryFn: async ({ queryKey, signal }) => { 456 449 const { data } = await logoutUser({ 457 450 ...options, ··· 493 486 * 494 487 * Get user detail based on username. 495 488 */ 496 - export const getUserByNameOptions = (options: Options<GetUserByNameData>) => 497 - queryOptions({ 489 + export const getUserByNameOptions = (options: Options<GetUserByNameData>) => queryOptions({ 498 490 queryFn: async ({ queryKey, signal }) => { 499 491 const { data } = await getUserByName({ 500 492 ...options,
+27 -38
examples/openapi-ts-tanstack-vue-query/src/client/sdk.gen.ts
··· 86 86 */ 87 87 export const addPet = <ThrowOnError extends boolean = false>( 88 88 options: Options<AddPetData, ThrowOnError> 89 - ) => 90 - (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 89 + ) => (options.client ?? client).post<AddPetResponses, AddPetErrors, ThrowOnError>({ 91 90 security: [ 92 91 { 93 92 scheme: 'bearer', ··· 109 108 */ 110 109 export const updatePet = <ThrowOnError extends boolean = false>( 111 110 options: Options<UpdatePetData, ThrowOnError> 112 - ) => 113 - (options.client ?? client).put<UpdatePetResponses, UpdatePetErrors, ThrowOnError>({ 111 + ) => (options.client ?? client).put<UpdatePetResponses, UpdatePetErrors, ThrowOnError>({ 114 112 security: [ 115 113 { 116 114 scheme: 'bearer', ··· 132 130 */ 133 131 export const findPetsByStatus = <ThrowOnError extends boolean = false>( 134 132 options: Options<FindPetsByStatusData, ThrowOnError> 135 - ) => 136 - (options.client ?? client).get<FindPetsByStatusResponses, FindPetsByStatusErrors, ThrowOnError>({ 133 + ) => (options.client ?? client).get< 134 + FindPetsByStatusResponses, 135 + FindPetsByStatusErrors, 136 + ThrowOnError 137 + >({ 137 138 security: [ 138 139 { 139 140 scheme: 'bearer', ··· 151 152 */ 152 153 export const findPetsByTags = <ThrowOnError extends boolean = false>( 153 154 options: Options<FindPetsByTagsData, ThrowOnError> 154 - ) => 155 - (options.client ?? client).get<FindPetsByTagsResponses, FindPetsByTagsErrors, ThrowOnError>({ 155 + ) => (options.client ?? client).get< 156 + FindPetsByTagsResponses, 157 + FindPetsByTagsErrors, 158 + ThrowOnError 159 + >({ 156 160 security: [ 157 161 { 158 162 scheme: 'bearer', ··· 170 174 */ 171 175 export const deletePet = <ThrowOnError extends boolean = false>( 172 176 options: Options<DeletePetData, ThrowOnError> 173 - ) => 174 - (options.client ?? client).delete<DeletePetResponses, DeletePetErrors, ThrowOnError>({ 177 + ) => (options.client ?? client).delete<DeletePetResponses, DeletePetErrors, ThrowOnError>({ 175 178 security: [ 176 179 { 177 180 scheme: 'bearer', ··· 189 192 */ 190 193 export const getPetById = <ThrowOnError extends boolean = false>( 191 194 options: Options<GetPetByIdData, ThrowOnError> 192 - ) => 193 - (options.client ?? client).get<GetPetByIdResponses, GetPetByIdErrors, ThrowOnError>({ 195 + ) => (options.client ?? client).get<GetPetByIdResponses, GetPetByIdErrors, ThrowOnError>({ 194 196 security: [ 195 197 { 196 198 name: 'api_key', ··· 212 214 */ 213 215 export const updatePetWithForm = <ThrowOnError extends boolean = false>( 214 216 options: Options<UpdatePetWithFormData, ThrowOnError> 215 - ) => 216 - (options.client ?? client).post< 217 + ) => (options.client ?? client).post< 217 218 UpdatePetWithFormResponses, 218 219 UpdatePetWithFormErrors, 219 220 ThrowOnError ··· 235 236 */ 236 237 export const uploadFile = <ThrowOnError extends boolean = false>( 237 238 options: Options<UploadFileData, ThrowOnError> 238 - ) => 239 - (options.client ?? client).post<UploadFileResponses, UploadFileErrors, ThrowOnError>({ 239 + ) => (options.client ?? client).post<UploadFileResponses, UploadFileErrors, ThrowOnError>({ 240 240 bodySerializer: null, 241 241 security: [ 242 242 { ··· 259 259 */ 260 260 export const getInventory = <ThrowOnError extends boolean = false>( 261 261 options?: Options<GetInventoryData, ThrowOnError> 262 - ) => 263 - (options?.client ?? client).get<GetInventoryResponses, GetInventoryErrors, ThrowOnError>({ 262 + ) => (options?.client ?? client).get<GetInventoryResponses, GetInventoryErrors, ThrowOnError>({ 264 263 security: [ 265 264 { 266 265 name: 'api_key', ··· 278 277 */ 279 278 export const placeOrder = <ThrowOnError extends boolean = false>( 280 279 options?: Options<PlaceOrderData, ThrowOnError> 281 - ) => 282 - (options?.client ?? client).post<PlaceOrderResponses, PlaceOrderErrors, ThrowOnError>({ 280 + ) => (options?.client ?? client).post<PlaceOrderResponses, PlaceOrderErrors, ThrowOnError>({ 283 281 url: '/store/order', 284 282 ...options, 285 283 headers: { ··· 295 293 */ 296 294 export const deleteOrder = <ThrowOnError extends boolean = false>( 297 295 options: Options<DeleteOrderData, ThrowOnError> 298 - ) => 299 - (options.client ?? client).delete<DeleteOrderResponses, DeleteOrderErrors, ThrowOnError>({ 296 + ) => (options.client ?? client).delete<DeleteOrderResponses, DeleteOrderErrors, ThrowOnError>({ 300 297 url: '/store/order/{orderId}', 301 298 ...options 302 299 }) ··· 308 305 */ 309 306 export const getOrderById = <ThrowOnError extends boolean = false>( 310 307 options: Options<GetOrderByIdData, ThrowOnError> 311 - ) => 312 - (options.client ?? client).get<GetOrderByIdResponses, GetOrderByIdErrors, ThrowOnError>({ 308 + ) => (options.client ?? client).get<GetOrderByIdResponses, GetOrderByIdErrors, ThrowOnError>({ 313 309 url: '/store/order/{orderId}', 314 310 ...options 315 311 }) ··· 321 317 */ 322 318 export const createUser = <ThrowOnError extends boolean = false>( 323 319 options?: Options<CreateUserData, ThrowOnError> 324 - ) => 325 - (options?.client ?? client).post<CreateUserResponses, CreateUserErrors, ThrowOnError>({ 320 + ) => (options?.client ?? client).post<CreateUserResponses, CreateUserErrors, ThrowOnError>({ 326 321 url: '/user', 327 322 ...options, 328 323 headers: { ··· 338 333 */ 339 334 export const createUsersWithListInput = <ThrowOnError extends boolean = false>( 340 335 options?: Options<CreateUsersWithListInputData, ThrowOnError> 341 - ) => 342 - (options?.client ?? client).post< 336 + ) => (options?.client ?? client).post< 343 337 CreateUsersWithListInputResponses, 344 338 CreateUsersWithListInputErrors, 345 339 ThrowOnError ··· 359 353 */ 360 354 export const loginUser = <ThrowOnError extends boolean = false>( 361 355 options?: Options<LoginUserData, ThrowOnError> 362 - ) => 363 - (options?.client ?? client).get<LoginUserResponses, LoginUserErrors, ThrowOnError>({ 356 + ) => (options?.client ?? client).get<LoginUserResponses, LoginUserErrors, ThrowOnError>({ 364 357 url: '/user/login', 365 358 ...options 366 359 }) ··· 372 365 */ 373 366 export const logoutUser = <ThrowOnError extends boolean = false>( 374 367 options?: Options<LogoutUserData, ThrowOnError> 375 - ) => 376 - (options?.client ?? client).get<LogoutUserResponses, LogoutUserErrors, ThrowOnError>({ 368 + ) => (options?.client ?? client).get<LogoutUserResponses, LogoutUserErrors, ThrowOnError>({ 377 369 url: '/user/logout', 378 370 ...options 379 371 }) ··· 385 377 */ 386 378 export const deleteUser = <ThrowOnError extends boolean = false>( 387 379 options: Options<DeleteUserData, ThrowOnError> 388 - ) => 389 - (options.client ?? client).delete<DeleteUserResponses, DeleteUserErrors, ThrowOnError>({ 380 + ) => (options.client ?? client).delete<DeleteUserResponses, DeleteUserErrors, ThrowOnError>({ 390 381 url: '/user/{username}', 391 382 ...options 392 383 }) ··· 398 389 */ 399 390 export const getUserByName = <ThrowOnError extends boolean = false>( 400 391 options: Options<GetUserByNameData, ThrowOnError> 401 - ) => 402 - (options.client ?? client).get<GetUserByNameResponses, GetUserByNameErrors, ThrowOnError>({ 392 + ) => (options.client ?? client).get<GetUserByNameResponses, GetUserByNameErrors, ThrowOnError>({ 403 393 url: '/user/{username}', 404 394 ...options 405 395 }) ··· 411 401 */ 412 402 export const updateUser = <ThrowOnError extends boolean = false>( 413 403 options: Options<UpdateUserData, ThrowOnError> 414 - ) => 415 - (options.client ?? client).put<UpdateUserResponses, UpdateUserErrors, ThrowOnError>({ 404 + ) => (options.client ?? client).put<UpdateUserResponses, UpdateUserErrors, ThrowOnError>({ 416 405 url: '/user/{username}', 417 406 ...options, 418 407 headers: {
+17 -17
examples/openapi-ts-tanstack-vue-query/src/client/types.gen.ts
··· 5 5 } 6 6 7 7 export type Order = { 8 - complete?: boolean 9 - id?: number 10 - petId?: number 11 - quantity?: number 12 - shipDate?: string 8 + complete?: boolean, 9 + id?: number, 10 + petId?: number, 11 + quantity?: number, 12 + shipDate?: string, 13 13 /** 14 14 * Order Status 15 15 */ ··· 22 22 } 23 23 24 24 export type User = { 25 - email?: string 26 - firstName?: string 27 - id?: number 25 + email?: string, 26 + firstName?: string, 27 + id?: number, 28 28 lastName?: string 29 - password?: string 30 - phone?: string 29 + password?: string, 30 + phone?: string, 31 31 /** 32 32 * User Status 33 33 */ 34 - userStatus?: number 34 + userStatus?: number, 35 35 username?: string 36 36 } 37 37 ··· 41 41 } 42 42 43 43 export type Pet = { 44 - category?: Category 45 - id?: number 46 - name: string 44 + category?: Category, 45 + id?: number, 46 + name: string, 47 47 photoUrls: Array<string> 48 48 /** 49 49 * pet status in the store 50 50 */ 51 - status?: 'available' | 'pending' | 'sold' 51 + status?: 'available' | 'pending' | 'sold', 52 52 tags?: Array<Tag> 53 53 } 54 54 55 55 export type ApiResponse = { 56 56 code?: number 57 - message?: string 57 + message?: string, 58 58 type?: string 59 59 } 60 60 ··· 535 535 /** 536 536 * The password for login in clear text 537 537 */ 538 - password?: string 538 + password?: string, 539 539 /** 540 540 * The user name for login 541 541 */