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.

test(pinia-colada): update snapshots

+228 -500
+13 -51
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 import { type Options, FooBazService, BarBazService } from '../sdk.gen'; 4 - import { type _JSONValue, type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 4 + import { type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 5 5 import type { GetFooData, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse } from '../types.gen'; 6 6 import { client } from '../client.gen'; 7 7 8 - export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 10 - _id: string; 11 - baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 - query?: _JSONValue; 14 - tags?: _JSONValue; 15 - } 16 - ]; 17 - 18 - const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, tags?: ReadonlyArray<string>): [ 19 - QueryKey<TOptions>[0] 20 - ] => { 21 - const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 - if (tags) { 23 - params.tags = tags as unknown as undefined; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as undefined; 30 - } 31 - if (options?.path) { 32 - params.path = options.path; 33 - } 34 - if (options?.query) { 35 - params.query = options.query as unknown as undefined; 36 - } 37 - return [ 38 - params 39 - ]; 40 - }; 41 - 42 - export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 43 - 44 - export const getFooQuery = defineQueryOptions((options?: Options<GetFooData>) => ({ 45 - key: getFooQueryKey(options), 8 + export const getFooQuery = defineQueryOptions({ 9 + key: [ 10 + 'getFoo' 11 + ], 46 12 query: async () => { 47 - const { data } = await FooBazService.getFoo({ 48 - throwOnError: true 49 - }); 13 + const { data } = await FooBazService.getFoo({ throwOnError: true }); 50 14 return data; 51 15 } 52 - })); 16 + }); 53 17 54 18 export const fooPostMutation = (options?: Partial<Options<FooPostData>>): UseMutationOptions<FooPostResponse, Options<FooPostData>, Error> => { 55 19 return { ··· 77 41 }; 78 42 }; 79 43 80 - export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 81 - 82 - export const getFooBarQuery = defineQueryOptions((options?: Options<GetFooBarData>) => ({ 83 - key: getFooBarQueryKey(options), 44 + export const getFooBarQuery = defineQueryOptions({ 45 + key: [ 46 + 'getFooBar' 47 + ], 84 48 query: async () => { 85 - const { data } = await BarBazService.getFooBar({ 86 - throwOnError: true 87 - }); 49 + const { data } = await BarBazService.getFooBar({ throwOnError: true }); 88 50 return data; 89 51 } 90 - })); 52 + }); 91 53 92 54 export const fooBarPostMutation = (options?: Partial<Options<FooBarPostData>>): UseMutationOptions<FooBarPostResponse, Options<FooBarPostData>, Error> => { 93 55 return {
+53 -103
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 import { type Options, serviceWithEmptyTag, patchApiVbyApiVersionNoTag, fooWow, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, callWithDescriptions, callWithParameters, callWithWeirdParameterNames, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, complexTypes, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, postApiVbyApiVersionBody } from '../sdk.gen'; 4 - import { type _JSONValue, type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 4 + import { type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 5 5 import type { ServiceWithEmptyTagData, PatchApiVbyApiVersionNoTagData, FooWowData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, CallWithDescriptionsData, CallWithParametersData, CallWithWeirdParameterNamesData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, ComplexTypesData, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PostApiVbyApiVersionBodyData, PostApiVbyApiVersionBodyError, PostApiVbyApiVersionBodyResponse } from '../types.gen'; 6 6 import { client } from '../client.gen'; 7 7 8 - export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 10 - _id: string; 11 - baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 - query?: _JSONValue; 14 - tags?: _JSONValue; 15 - } 16 - ]; 17 - 18 - const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, tags?: ReadonlyArray<string>): [ 19 - QueryKey<TOptions>[0] 20 - ] => { 21 - const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 - if (tags) { 23 - params.tags = tags as unknown as undefined; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as undefined; 30 - } 31 - if (options?.path) { 32 - params.path = options.path; 33 - } 34 - if (options?.query) { 35 - params.query = options.query as unknown as undefined; 36 - } 37 - return [ 38 - params 39 - ]; 40 - }; 41 - 42 - export const serviceWithEmptyTagQueryKey = (options?: Options<ServiceWithEmptyTagData>) => createQueryKey('serviceWithEmptyTag', options); 43 - 44 - export const serviceWithEmptyTagQuery = defineQueryOptions((options?: Options<ServiceWithEmptyTagData>) => ({ 45 - key: serviceWithEmptyTagQueryKey(options), 8 + export const serviceWithEmptyTagQuery = defineQueryOptions({ 9 + key: [ 10 + 'serviceWithEmptyTag' 11 + ], 46 12 query: async () => { 47 - const { data } = await serviceWithEmptyTag({ 48 - throwOnError: true 49 - }); 13 + const { data } = await serviceWithEmptyTag({ throwOnError: true }); 50 14 return data; 51 15 } 52 - })); 16 + }); 53 17 54 18 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, Options<PatchApiVbyApiVersionNoTagData>, Error> => { 55 19 return { ··· 90 54 }; 91 55 }; 92 56 93 - export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 94 - 95 - export const getCallWithoutParametersAndResponseQuery = defineQueryOptions((options?: Options<GetCallWithoutParametersAndResponseData>) => ({ 96 - key: getCallWithoutParametersAndResponseQueryKey(options), 57 + export const getCallWithoutParametersAndResponseQuery = defineQueryOptions({ 58 + key: [ 59 + 'getCallWithoutParametersAndResponse' 60 + ], 97 61 query: async () => { 98 - const { data } = await getCallWithoutParametersAndResponse({ 99 - throwOnError: true 100 - }); 62 + const { data } = await getCallWithoutParametersAndResponse({ throwOnError: true }); 101 63 return data; 102 64 } 103 - })); 65 + }); 104 66 105 67 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, Options<PatchCallWithoutParametersAndResponseData>, Error> => { 106 68 return { ··· 180 142 }; 181 143 }; 182 144 183 - export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 145 + export const callWithDefaultParametersQueryKey = (options: Options<CallWithDefaultParametersData>) => _heyapi_187_('callWithDefaultParameters', options); 184 146 185 147 export const callWithDefaultParametersQuery = defineQueryOptions((options: Options<CallWithDefaultParametersData>) => ({ 186 148 key: callWithDefaultParametersQueryKey(options), ··· 232 194 }; 233 195 }; 234 196 235 - export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 236 - 237 - export const duplicateName2Query = defineQueryOptions((options?: Options<DuplicateName2Data>) => ({ 238 - key: duplicateName2QueryKey(options), 197 + export const duplicateName2Query = defineQueryOptions({ 198 + key: [ 199 + 'duplicateName2' 200 + ], 239 201 query: async () => { 240 - const { data } = await duplicateName2({ 241 - throwOnError: true 242 - }); 202 + const { data } = await duplicateName2({ throwOnError: true }); 243 203 return data; 244 204 } 245 - })); 205 + }); 246 206 247 207 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, Options<DuplicateName3Data>, Error> => { 248 208 return { ··· 270 230 }; 271 231 }; 272 232 273 - export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 274 - 275 - export const callWithNoContentResponseQuery = defineQueryOptions((options?: Options<CallWithNoContentResponseData>) => ({ 276 - key: callWithNoContentResponseQueryKey(options), 233 + export const callWithNoContentResponseQuery = defineQueryOptions({ 234 + key: [ 235 + 'callWithNoContentResponse' 236 + ], 277 237 query: async () => { 278 - const { data } = await callWithNoContentResponse({ 279 - throwOnError: true 280 - }); 238 + const { data } = await callWithNoContentResponse({ throwOnError: true }); 281 239 return data; 282 240 } 283 - })); 241 + }); 284 242 285 - export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 286 - 287 - export const callWithResponseAndNoContentResponseQuery = defineQueryOptions((options?: Options<CallWithResponseAndNoContentResponseData>) => ({ 288 - key: callWithResponseAndNoContentResponseQueryKey(options), 243 + export const callWithResponseAndNoContentResponseQuery = defineQueryOptions({ 244 + key: [ 245 + 'callWithResponseAndNoContentResponse' 246 + ], 289 247 query: async () => { 290 - const { data } = await callWithResponseAndNoContentResponse({ 291 - throwOnError: true 292 - }); 248 + const { data } = await callWithResponseAndNoContentResponse({ throwOnError: true }); 293 249 return data; 294 250 } 295 - })); 251 + }); 296 252 297 - export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 298 - 299 - export const dummyAQuery = defineQueryOptions((options?: Options<DummyAData>) => ({ 300 - key: dummyAQueryKey(options), 253 + export const dummyAQuery = defineQueryOptions({ 254 + key: [ 255 + 'dummyA' 256 + ], 301 257 query: async () => { 302 - const { data } = await dummyA({ 303 - throwOnError: true 304 - }); 258 + const { data } = await dummyA({ throwOnError: true }); 305 259 return data; 306 260 } 307 - })); 308 - 309 - export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 261 + }); 310 262 311 - export const dummyBQuery = defineQueryOptions((options?: Options<DummyBData>) => ({ 312 - key: dummyBQueryKey(options), 263 + export const dummyBQuery = defineQueryOptions({ 264 + key: [ 265 + 'dummyB' 266 + ], 313 267 query: async () => { 314 - const { data } = await dummyB({ 315 - throwOnError: true 316 - }); 268 + const { data } = await dummyB({ throwOnError: true }); 317 269 return data; 318 270 } 319 - })); 271 + }); 320 272 321 - export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 322 - 323 - export const callWithResponseQuery = defineQueryOptions((options?: Options<CallWithResponseData>) => ({ 324 - key: callWithResponseQueryKey(options), 273 + export const callWithResponseQuery = defineQueryOptions({ 274 + key: [ 275 + 'callWithResponse' 276 + ], 325 277 query: async () => { 326 - const { data } = await callWithResponse({ 327 - throwOnError: true 328 - }); 278 + const { data } = await callWithResponse({ throwOnError: true }); 329 279 return data; 330 280 } 331 - })); 281 + }); 332 282 333 283 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, Options<CallWithDuplicateResponsesData>, CallWithDuplicateResponsesError> => { 334 284 return { ··· 356 306 }; 357 307 }; 358 308 359 - export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 309 + export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => 2('collectionFormat', options); 360 310 361 311 export const collectionFormatQuery = defineQueryOptions((options: Options<CollectionFormatData>) => ({ 362 312 key: collectionFormatQueryKey(options), ··· 369 319 } 370 320 })); 371 321 372 - export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 322 + export const typesQueryKey = (options: Options<TypesData>) => 2('types', options); 373 323 374 324 export const typesQuery = defineQueryOptions((options: Options<TypesData>) => ({ 375 325 key: typesQueryKey(options), ··· 382 332 } 383 333 })); 384 334 385 - export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 335 + export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => 2('complexTypes', options); 386 336 387 337 export const complexTypesQuery = defineQueryOptions((options: Options<ComplexTypesData>) => ({ 388 338 key: complexTypesQueryKey(options),
+13 -51
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 import { type Options, FooBazService, BarBazService } from '../sdk.gen'; 4 - import { type _JSONValue, type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 4 + import { type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 5 5 import type { GetFooData, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse } from '../types.gen'; 6 6 import { client } from '../client.gen'; 7 7 8 - export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 10 - _id: string; 11 - baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 - query?: _JSONValue; 14 - tags?: _JSONValue; 15 - } 16 - ]; 17 - 18 - const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, tags?: ReadonlyArray<string>): [ 19 - QueryKey<TOptions>[0] 20 - ] => { 21 - const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 - if (tags) { 23 - params.tags = tags as unknown as undefined; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as undefined; 30 - } 31 - if (options?.path) { 32 - params.path = options.path; 33 - } 34 - if (options?.query) { 35 - params.query = options.query as unknown as undefined; 36 - } 37 - return [ 38 - params 39 - ]; 40 - }; 41 - 42 - export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 43 - 44 - export const getFooQuery = defineQueryOptions((options?: Options<GetFooData>) => ({ 45 - key: getFooQueryKey(options), 8 + export const getFooQuery = defineQueryOptions({ 9 + key: [ 10 + 'getFoo' 11 + ], 46 12 query: async () => { 47 - const { data } = await FooBazService.getFoo({ 48 - throwOnError: true 49 - }); 13 + const { data } = await FooBazService.getFoo({ throwOnError: true }); 50 14 return data; 51 15 } 52 - })); 16 + }); 53 17 54 18 export const fooPostMutation = (options?: Partial<Options<FooPostData>>): UseMutationOptions<FooPostResponse, Options<FooPostData>, Error> => { 55 19 return { ··· 77 41 }; 78 42 }; 79 43 80 - export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 81 - 82 - export const getFooBarQuery = defineQueryOptions((options?: Options<GetFooBarData>) => ({ 83 - key: getFooBarQueryKey(options), 44 + export const getFooBarQuery = defineQueryOptions({ 45 + key: [ 46 + 'getFooBar' 47 + ], 84 48 query: async () => { 85 - const { data } = await BarBazService.getFooBar({ 86 - throwOnError: true 87 - }); 49 + const { data } = await BarBazService.getFooBar({ throwOnError: true }); 88 50 return data; 89 51 } 90 - })); 52 + }); 91 53 92 54 export const fooBarPostMutation = (options?: Partial<Options<FooBarPostData>>): UseMutationOptions<FooBarPostResponse, Options<FooBarPostData>, Error> => { 93 55 return {
+68 -122
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; 4 - import { type _JSONValue, type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 4 + import { type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 5 5 import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3 as DeleteFooData, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; 6 6 import { client } from '../client.gen'; 7 7 8 - export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 10 - _id: string; 11 - baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 - query?: _JSONValue; 14 - tags?: _JSONValue; 15 - } 16 - ]; 17 - 18 - const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, tags?: ReadonlyArray<string>): [ 19 - QueryKey<TOptions>[0] 20 - ] => { 21 - const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 - if (tags) { 23 - params.tags = tags as unknown as undefined; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as undefined; 30 - } 31 - if (options?.path) { 32 - params.path = options.path; 33 - } 34 - if (options?.query) { 35 - params.query = options.query as unknown as undefined; 36 - } 37 - return [ 38 - params 39 - ]; 40 - }; 41 - 42 - export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 43 - 44 - export const exportQuery = defineQueryOptions((options?: Options<ExportData>) => ({ 45 - key: exportQueryKey(options), 8 + export const exportQuery = defineQueryOptions({ 9 + key: [ 10 + 'export' 11 + ], 46 12 query: async () => { 47 - const { data } = await export_({ 48 - throwOnError: true 49 - }); 13 + const { data } = await export_({ throwOnError: true }); 50 14 return data; 51 15 } 52 - })); 16 + }); 53 17 54 18 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, Options<PatchApiVbyApiVersionNoTagData>, Error> => { 55 19 return { ··· 90 54 }; 91 55 }; 92 56 93 - export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 94 - 95 - export const apiVVersionODataControllerCountQuery = defineQueryOptions((options?: Options<ApiVVersionODataControllerCountData>) => ({ 96 - key: apiVVersionODataControllerCountQueryKey(options), 57 + export const apiVVersionODataControllerCountQuery = defineQueryOptions({ 58 + key: [ 59 + 'apiVVersionODataControllerCount' 60 + ], 97 61 query: async () => { 98 - const { data } = await apiVVersionODataControllerCount({ 99 - throwOnError: true 100 - }); 62 + const { data } = await apiVVersionODataControllerCount({ throwOnError: true }); 101 63 return data; 102 64 } 103 - })); 65 + }); 104 66 105 - export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 67 + export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => _heyapi_308_('getApiVbyApiVersionSimpleOperation', options); 106 68 107 69 export const getApiVbyApiVersionSimpleOperationQuery = defineQueryOptions((options: Options<GetApiVbyApiVersionSimpleOperationData>) => ({ 108 70 key: getApiVbyApiVersionSimpleOperationQueryKey(options), ··· 128 90 }; 129 91 }; 130 92 131 - export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 132 - 133 - export const getCallWithoutParametersAndResponseQuery = defineQueryOptions((options?: Options<GetCallWithoutParametersAndResponseData>) => ({ 134 - key: getCallWithoutParametersAndResponseQueryKey(options), 93 + export const getCallWithoutParametersAndResponseQuery = defineQueryOptions({ 94 + key: [ 95 + 'getCallWithoutParametersAndResponse' 96 + ], 135 97 query: async () => { 136 - const { data } = await getCallWithoutParametersAndResponse({ 137 - throwOnError: true 138 - }); 98 + const { data } = await getCallWithoutParametersAndResponse({ throwOnError: true }); 139 99 return data; 140 100 } 141 - })); 101 + }); 142 102 143 103 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, Options<PatchCallWithoutParametersAndResponseData>, Error> => { 144 104 return { ··· 247 207 }; 248 208 }; 249 209 250 - export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 210 + export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => 2('getCallWithOptionalParam', options); 251 211 252 212 export const getCallWithOptionalParamQuery = defineQueryOptions((options: Options<GetCallWithOptionalParamData>) => ({ 253 213 key: getCallWithOptionalParamQueryKey(options), ··· 299 259 }; 300 260 }; 301 261 302 - export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 262 + export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => 2('callWithDefaultParameters', options); 303 263 304 264 export const callWithDefaultParametersQuery = defineQueryOptions((options?: Options<CallWithDefaultParametersData>) => ({ 305 265 key: callWithDefaultParametersQueryKey(options), ··· 350 310 }; 351 311 }; 352 312 353 - export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 354 - 355 - export const duplicateName2Query = defineQueryOptions((options?: Options<DuplicateName2Data>) => ({ 356 - key: duplicateName2QueryKey(options), 313 + export const duplicateName2Query = defineQueryOptions({ 314 + key: [ 315 + 'duplicateName2' 316 + ], 357 317 query: async () => { 358 - const { data } = await duplicateName2({ 359 - throwOnError: true 360 - }); 318 + const { data } = await duplicateName2({ throwOnError: true }); 361 319 return data; 362 320 } 363 - })); 321 + }); 364 322 365 323 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, Options<DuplicateName3Data>, Error> => { 366 324 return { ··· 388 346 }; 389 347 }; 390 348 391 - export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 392 - 393 - export const callWithNoContentResponseQuery = defineQueryOptions((options?: Options<CallWithNoContentResponseData>) => ({ 394 - key: callWithNoContentResponseQueryKey(options), 349 + export const callWithNoContentResponseQuery = defineQueryOptions({ 350 + key: [ 351 + 'callWithNoContentResponse' 352 + ], 395 353 query: async () => { 396 - const { data } = await callWithNoContentResponse({ 397 - throwOnError: true 398 - }); 354 + const { data } = await callWithNoContentResponse({ throwOnError: true }); 399 355 return data; 400 356 } 401 - })); 402 - 403 - export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 357 + }); 404 358 405 - export const callWithResponseAndNoContentResponseQuery = defineQueryOptions((options?: Options<CallWithResponseAndNoContentResponseData>) => ({ 406 - key: callWithResponseAndNoContentResponseQueryKey(options), 359 + export const callWithResponseAndNoContentResponseQuery = defineQueryOptions({ 360 + key: [ 361 + 'callWithResponseAndNoContentResponse' 362 + ], 407 363 query: async () => { 408 - const { data } = await callWithResponseAndNoContentResponse({ 409 - throwOnError: true 410 - }); 364 + const { data } = await callWithResponseAndNoContentResponse({ throwOnError: true }); 411 365 return data; 412 366 } 413 - })); 414 - 415 - export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 367 + }); 416 368 417 - export const dummyAQuery = defineQueryOptions((options?: Options<DummyAData>) => ({ 418 - key: dummyAQueryKey(options), 369 + export const dummyAQuery = defineQueryOptions({ 370 + key: [ 371 + 'dummyA' 372 + ], 419 373 query: async () => { 420 - const { data } = await dummyA({ 421 - throwOnError: true 422 - }); 374 + const { data } = await dummyA({ throwOnError: true }); 423 375 return data; 424 376 } 425 - })); 377 + }); 426 378 427 - export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 428 - 429 - export const dummyBQuery = defineQueryOptions((options?: Options<DummyBData>) => ({ 430 - key: dummyBQueryKey(options), 379 + export const dummyBQuery = defineQueryOptions({ 380 + key: [ 381 + 'dummyB' 382 + ], 431 383 query: async () => { 432 - const { data } = await dummyB({ 433 - throwOnError: true 434 - }); 384 + const { data } = await dummyB({ throwOnError: true }); 435 385 return data; 436 386 } 437 - })); 438 - 439 - export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 387 + }); 440 388 441 - export const callWithResponseQuery = defineQueryOptions((options?: Options<CallWithResponseData>) => ({ 442 - key: callWithResponseQueryKey(options), 389 + export const callWithResponseQuery = defineQueryOptions({ 390 + key: [ 391 + 'callWithResponse' 392 + ], 443 393 query: async () => { 444 - const { data } = await callWithResponse({ 445 - throwOnError: true 446 - }); 394 + const { data } = await callWithResponse({ throwOnError: true }); 447 395 return data; 448 396 } 449 - })); 397 + }); 450 398 451 399 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, Options<CallWithDuplicateResponsesData>, CallWithDuplicateResponsesError> => { 452 400 return { ··· 474 422 }; 475 423 }; 476 424 477 - export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 425 + export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => 2('collectionFormat', options); 478 426 479 427 export const collectionFormatQuery = defineQueryOptions((options: Options<CollectionFormatData>) => ({ 480 428 key: collectionFormatQueryKey(options), ··· 487 435 } 488 436 })); 489 437 490 - export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 438 + export const typesQueryKey = (options: Options<TypesData>) => 2('types', options); 491 439 492 440 export const typesQuery = defineQueryOptions((options: Options<TypesData>) => ({ 493 441 key: typesQueryKey(options), ··· 513 461 }; 514 462 }; 515 463 516 - export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 464 + export const fileResponseQueryKey = (options: Options<FileResponseData>) => 2('fileResponse', options); 517 465 518 466 export const fileResponseQuery = defineQueryOptions((options: Options<FileResponseData>) => ({ 519 467 key: fileResponseQueryKey(options), ··· 526 474 } 527 475 })); 528 476 529 - export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 477 + export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => 2('complexTypes', options); 530 478 531 479 export const complexTypesQuery = defineQueryOptions((options: Options<ComplexTypesData>) => ({ 532 480 key: complexTypesQueryKey(options), ··· 539 487 } 540 488 })); 541 489 542 - export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 543 - 544 - export const multipartResponseQuery = defineQueryOptions((options?: Options<MultipartResponseData>) => ({ 545 - key: multipartResponseQueryKey(options), 490 + export const multipartResponseQuery = defineQueryOptions({ 491 + key: [ 492 + 'multipartResponse' 493 + ], 546 494 query: async () => { 547 - const { data } = await multipartResponse({ 548 - throwOnError: true 549 - }); 495 + const { data } = await multipartResponse({ throwOnError: true }); 550 496 return data; 551 497 } 552 - })); 498 + }); 553 499 554 500 export const multipartRequestMutation = (options?: Partial<Options<MultipartRequestData>>): UseMutationOptions<unknown, Options<MultipartRequestData>, Error> => { 555 501 return {
+13 -51
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/asClass/@pinia/colada.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 import { type Options, FooBazService, BarBazService } from '../sdk.gen'; 4 - import { type _JSONValue, type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 4 + import { type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 5 5 import type { GetFooData, FooPostData, FooPostResponse, FooPutData, FooPutResponse, GetFooBarData, FooBarPostData, FooBarPostResponse, FooBarPutData, FooBarPutResponse } from '../types.gen'; 6 6 import { client } from '../client.gen'; 7 7 8 - export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 10 - _id: string; 11 - baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 - query?: _JSONValue; 14 - tags?: _JSONValue; 15 - } 16 - ]; 17 - 18 - const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, tags?: ReadonlyArray<string>): [ 19 - QueryKey<TOptions>[0] 20 - ] => { 21 - const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 - if (tags) { 23 - params.tags = tags as unknown as undefined; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as undefined; 30 - } 31 - if (options?.path) { 32 - params.path = options.path; 33 - } 34 - if (options?.query) { 35 - params.query = options.query as unknown as undefined; 36 - } 37 - return [ 38 - params 39 - ]; 40 - }; 41 - 42 - export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options); 43 - 44 - export const getFooQuery = defineQueryOptions((options?: Options<GetFooData>) => ({ 45 - key: getFooQueryKey(options), 8 + export const getFooQuery = defineQueryOptions({ 9 + key: [ 10 + 'getFoo' 11 + ], 46 12 query: async () => { 47 - const { data } = await FooBazService.getFoo({ 48 - throwOnError: true 49 - }); 13 + const { data } = await FooBazService.getFoo({ throwOnError: true }); 50 14 return data; 51 15 } 52 - })); 16 + }); 53 17 54 18 export const fooPostMutation = (options?: Partial<Options<FooPostData>>): UseMutationOptions<FooPostResponse, Options<FooPostData>, Error> => { 55 19 return { ··· 77 41 }; 78 42 }; 79 43 80 - export const getFooBarQueryKey = (options?: Options<GetFooBarData>) => createQueryKey('getFooBar', options); 81 - 82 - export const getFooBarQuery = defineQueryOptions((options?: Options<GetFooBarData>) => ({ 83 - key: getFooBarQueryKey(options), 44 + export const getFooBarQuery = defineQueryOptions({ 45 + key: [ 46 + 'getFooBar' 47 + ], 84 48 query: async () => { 85 - const { data } = await BarBazService.getFooBar({ 86 - throwOnError: true 87 - }); 49 + const { data } = await BarBazService.getFooBar({ throwOnError: true }); 88 50 return data; 89 51 } 90 - })); 52 + }); 91 53 92 54 export const fooBarPostMutation = (options?: Partial<Options<FooBarPostData>>): UseMutationOptions<FooBarPostResponse, Options<FooBarPostData>, Error> => { 93 55 return {
+68 -122
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/@pinia/colada.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 3 import { type Options, export_, patchApiVbyApiVersionNoTag, import_, fooWow, apiVVersionODataControllerCount, getApiVbyApiVersionSimpleOperation, deleteCallWithoutParametersAndResponse, getCallWithoutParametersAndResponse, patchCallWithoutParametersAndResponse, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, deleteFoo, callWithDescriptions, deprecatedCall, callWithParameters, callWithWeirdParameterNames, getCallWithOptionalParam, postCallWithOptionalParam, postApiVbyApiVersionRequestBody, postApiVbyApiVersionFormData, callWithDefaultParameters, callWithDefaultOptionalParameters, callToTestOrderOfParams, duplicateName, duplicateName2, duplicateName3, duplicateName4, callWithNoContentResponse, callWithResponseAndNoContentResponse, dummyA, dummyB, callWithResponse, callWithDuplicateResponses, callWithResponses, collectionFormat, types, uploadFile, fileResponse, complexTypes, multipartResponse, multipartRequest, complexParams, callWithResultFromHeader, testErrorCode, nonAsciiæøåÆøÅöôêÊ字符串, putWithFormUrlEncoded } from '../sdk.gen'; 4 - import { type _JSONValue, type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 4 + import { type UseQueryOptions, defineQueryOptions, type UseMutationOptions } from '@pinia/colada'; 5 5 import type { ExportData, PatchApiVbyApiVersionNoTagData, ImportData, ImportResponse, FooWowData, ApiVVersionODataControllerCountData, GetApiVbyApiVersionSimpleOperationData, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3 as DeleteFooData, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithResponseAndNoContentResponseData, DummyAData, DummyBData, CallWithResponseData, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, UploadFileData, UploadFileResponse, FileResponseData, ComplexTypesData, MultipartResponseData, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from '../types.gen'; 6 6 import { client } from '../client.gen'; 7 7 8 - export type QueryKey<TOptions extends Options> = [ 9 - Pick<TOptions, 'body' | 'path'> & { 10 - _id: string; 11 - baseUrl?: _JSONValue; 12 - headers?: _JSONValue; 13 - query?: _JSONValue; 14 - tags?: _JSONValue; 15 - } 16 - ]; 17 - 18 - const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, tags?: ReadonlyArray<string>): [ 19 - QueryKey<TOptions>[0] 20 - ] => { 21 - const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0]; 22 - if (tags) { 23 - params.tags = tags as unknown as undefined; 24 - } 25 - if (options?.body) { 26 - params.body = options.body; 27 - } 28 - if (options?.headers) { 29 - params.headers = options.headers as unknown as undefined; 30 - } 31 - if (options?.path) { 32 - params.path = options.path; 33 - } 34 - if (options?.query) { 35 - params.query = options.query as unknown as undefined; 36 - } 37 - return [ 38 - params 39 - ]; 40 - }; 41 - 42 - export const exportQueryKey = (options?: Options<ExportData>) => createQueryKey('export', options); 43 - 44 - export const exportQuery = defineQueryOptions((options?: Options<ExportData>) => ({ 45 - key: exportQueryKey(options), 8 + export const exportQuery = defineQueryOptions({ 9 + key: [ 10 + 'export' 11 + ], 46 12 query: async () => { 47 - const { data } = await export_({ 48 - throwOnError: true 49 - }); 13 + const { data } = await export_({ throwOnError: true }); 50 14 return data; 51 15 } 52 - })); 16 + }); 53 17 54 18 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, Options<PatchApiVbyApiVersionNoTagData>, Error> => { 55 19 return { ··· 90 54 }; 91 55 }; 92 56 93 - export const apiVVersionODataControllerCountQueryKey = (options?: Options<ApiVVersionODataControllerCountData>) => createQueryKey('apiVVersionODataControllerCount', options); 94 - 95 - export const apiVVersionODataControllerCountQuery = defineQueryOptions((options?: Options<ApiVVersionODataControllerCountData>) => ({ 96 - key: apiVVersionODataControllerCountQueryKey(options), 57 + export const apiVVersionODataControllerCountQuery = defineQueryOptions({ 58 + key: [ 59 + 'apiVVersionODataControllerCount' 60 + ], 97 61 query: async () => { 98 - const { data } = await apiVVersionODataControllerCount({ 99 - throwOnError: true 100 - }); 62 + const { data } = await apiVVersionODataControllerCount({ throwOnError: true }); 101 63 return data; 102 64 } 103 - })); 65 + }); 104 66 105 - export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 67 + export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => _heyapi_308_('getApiVbyApiVersionSimpleOperation', options); 106 68 107 69 export const getApiVbyApiVersionSimpleOperationQuery = defineQueryOptions((options: Options<GetApiVbyApiVersionSimpleOperationData>) => ({ 108 70 key: getApiVbyApiVersionSimpleOperationQueryKey(options), ··· 128 90 }; 129 91 }; 130 92 131 - export const getCallWithoutParametersAndResponseQueryKey = (options?: Options<GetCallWithoutParametersAndResponseData>) => createQueryKey('getCallWithoutParametersAndResponse', options); 132 - 133 - export const getCallWithoutParametersAndResponseQuery = defineQueryOptions((options?: Options<GetCallWithoutParametersAndResponseData>) => ({ 134 - key: getCallWithoutParametersAndResponseQueryKey(options), 93 + export const getCallWithoutParametersAndResponseQuery = defineQueryOptions({ 94 + key: [ 95 + 'getCallWithoutParametersAndResponse' 96 + ], 135 97 query: async () => { 136 - const { data } = await getCallWithoutParametersAndResponse({ 137 - throwOnError: true 138 - }); 98 + const { data } = await getCallWithoutParametersAndResponse({ throwOnError: true }); 139 99 return data; 140 100 } 141 - })); 101 + }); 142 102 143 103 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, Options<PatchCallWithoutParametersAndResponseData>, Error> => { 144 104 return { ··· 247 207 }; 248 208 }; 249 209 250 - export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => createQueryKey('getCallWithOptionalParam', options); 210 + export const getCallWithOptionalParamQueryKey = (options: Options<GetCallWithOptionalParamData>) => 2('getCallWithOptionalParam', options); 251 211 252 212 export const getCallWithOptionalParamQuery = defineQueryOptions((options: Options<GetCallWithOptionalParamData>) => ({ 253 213 key: getCallWithOptionalParamQueryKey(options), ··· 299 259 }; 300 260 }; 301 261 302 - export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => createQueryKey('callWithDefaultParameters', options); 262 + export const callWithDefaultParametersQueryKey = (options?: Options<CallWithDefaultParametersData>) => 2('callWithDefaultParameters', options); 303 263 304 264 export const callWithDefaultParametersQuery = defineQueryOptions((options?: Options<CallWithDefaultParametersData>) => ({ 305 265 key: callWithDefaultParametersQueryKey(options), ··· 350 310 }; 351 311 }; 352 312 353 - export const duplicateName2QueryKey = (options?: Options<DuplicateName2Data>) => createQueryKey('duplicateName2', options); 354 - 355 - export const duplicateName2Query = defineQueryOptions((options?: Options<DuplicateName2Data>) => ({ 356 - key: duplicateName2QueryKey(options), 313 + export const duplicateName2Query = defineQueryOptions({ 314 + key: [ 315 + 'duplicateName2' 316 + ], 357 317 query: async () => { 358 - const { data } = await duplicateName2({ 359 - throwOnError: true 360 - }); 318 + const { data } = await duplicateName2({ throwOnError: true }); 361 319 return data; 362 320 } 363 - })); 321 + }); 364 322 365 323 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, Options<DuplicateName3Data>, Error> => { 366 324 return { ··· 388 346 }; 389 347 }; 390 348 391 - export const callWithNoContentResponseQueryKey = (options?: Options<CallWithNoContentResponseData>) => createQueryKey('callWithNoContentResponse', options); 392 - 393 - export const callWithNoContentResponseQuery = defineQueryOptions((options?: Options<CallWithNoContentResponseData>) => ({ 394 - key: callWithNoContentResponseQueryKey(options), 349 + export const callWithNoContentResponseQuery = defineQueryOptions({ 350 + key: [ 351 + 'callWithNoContentResponse' 352 + ], 395 353 query: async () => { 396 - const { data } = await callWithNoContentResponse({ 397 - throwOnError: true 398 - }); 354 + const { data } = await callWithNoContentResponse({ throwOnError: true }); 399 355 return data; 400 356 } 401 - })); 402 - 403 - export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 357 + }); 404 358 405 - export const callWithResponseAndNoContentResponseQuery = defineQueryOptions((options?: Options<CallWithResponseAndNoContentResponseData>) => ({ 406 - key: callWithResponseAndNoContentResponseQueryKey(options), 359 + export const callWithResponseAndNoContentResponseQuery = defineQueryOptions({ 360 + key: [ 361 + 'callWithResponseAndNoContentResponse' 362 + ], 407 363 query: async () => { 408 - const { data } = await callWithResponseAndNoContentResponse({ 409 - throwOnError: true 410 - }); 364 + const { data } = await callWithResponseAndNoContentResponse({ throwOnError: true }); 411 365 return data; 412 366 } 413 - })); 414 - 415 - export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 367 + }); 416 368 417 - export const dummyAQuery = defineQueryOptions((options?: Options<DummyAData>) => ({ 418 - key: dummyAQueryKey(options), 369 + export const dummyAQuery = defineQueryOptions({ 370 + key: [ 371 + 'dummyA' 372 + ], 419 373 query: async () => { 420 - const { data } = await dummyA({ 421 - throwOnError: true 422 - }); 374 + const { data } = await dummyA({ throwOnError: true }); 423 375 return data; 424 376 } 425 - })); 377 + }); 426 378 427 - export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 428 - 429 - export const dummyBQuery = defineQueryOptions((options?: Options<DummyBData>) => ({ 430 - key: dummyBQueryKey(options), 379 + export const dummyBQuery = defineQueryOptions({ 380 + key: [ 381 + 'dummyB' 382 + ], 431 383 query: async () => { 432 - const { data } = await dummyB({ 433 - throwOnError: true 434 - }); 384 + const { data } = await dummyB({ throwOnError: true }); 435 385 return data; 436 386 } 437 - })); 438 - 439 - export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 387 + }); 440 388 441 - export const callWithResponseQuery = defineQueryOptions((options?: Options<CallWithResponseData>) => ({ 442 - key: callWithResponseQueryKey(options), 389 + export const callWithResponseQuery = defineQueryOptions({ 390 + key: [ 391 + 'callWithResponse' 392 + ], 443 393 query: async () => { 444 - const { data } = await callWithResponse({ 445 - throwOnError: true 446 - }); 394 + const { data } = await callWithResponse({ throwOnError: true }); 447 395 return data; 448 396 } 449 - })); 397 + }); 450 398 451 399 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, Options<CallWithDuplicateResponsesData>, CallWithDuplicateResponsesError> => { 452 400 return { ··· 474 422 }; 475 423 }; 476 424 477 - export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => createQueryKey('collectionFormat', options); 425 + export const collectionFormatQueryKey = (options: Options<CollectionFormatData>) => 2('collectionFormat', options); 478 426 479 427 export const collectionFormatQuery = defineQueryOptions((options: Options<CollectionFormatData>) => ({ 480 428 key: collectionFormatQueryKey(options), ··· 487 435 } 488 436 })); 489 437 490 - export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 438 + export const typesQueryKey = (options: Options<TypesData>) => 2('types', options); 491 439 492 440 export const typesQuery = defineQueryOptions((options: Options<TypesData>) => ({ 493 441 key: typesQueryKey(options), ··· 513 461 }; 514 462 }; 515 463 516 - export const fileResponseQueryKey = (options: Options<FileResponseData>) => createQueryKey('fileResponse', options); 464 + export const fileResponseQueryKey = (options: Options<FileResponseData>) => 2('fileResponse', options); 517 465 518 466 export const fileResponseQuery = defineQueryOptions((options: Options<FileResponseData>) => ({ 519 467 key: fileResponseQueryKey(options), ··· 526 474 } 527 475 })); 528 476 529 - export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 477 + export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => 2('complexTypes', options); 530 478 531 479 export const complexTypesQuery = defineQueryOptions((options: Options<ComplexTypesData>) => ({ 532 480 key: complexTypesQueryKey(options), ··· 539 487 } 540 488 })); 541 489 542 - export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 543 - 544 - export const multipartResponseQuery = defineQueryOptions((options?: Options<MultipartResponseData>) => ({ 545 - key: multipartResponseQueryKey(options), 490 + export const multipartResponseQuery = defineQueryOptions({ 491 + key: [ 492 + 'multipartResponse' 493 + ], 546 494 query: async () => { 547 - const { data } = await multipartResponse({ 548 - throwOnError: true 549 - }); 495 + const { data } = await multipartResponse({ throwOnError: true }); 550 496 return data; 551 497 } 552 - })); 498 + }); 553 499 554 500 export const multipartRequestMutation = (options?: Partial<Options<MultipartRequestData>>): UseMutationOptions<unknown, Options<MultipartRequestData>, Error> => { 555 501 return {