Skip to content

Commit 6311821

Browse files
committed
fix: sync test and snapshots
1 parent aa0a60d commit 6311821

File tree

290 files changed

+1866
-6486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+1866
-6486
lines changed

examples/openapi-ts-fastify/src/client/client/client.gen.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -95,40 +95,7 @@ export const createClient = (config: Config = {}): Client => {
9595
// fetch must be assigned here, otherwise it would throw the error:
9696
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
9797
const _fetch = opts.fetch!;
98-
let response: Response;
99-
100-
try {
101-
response = await _fetch(request);
102-
} catch (error) {
103-
// Handle fetch exceptions (AbortError, network errors, etc.)
104-
let finalError = error;
105-
106-
for (const fn of interceptors.error.fns) {
107-
if (fn) {
108-
finalError = (await fn(
109-
error,
110-
undefined as any,
111-
request,
112-
opts,
113-
)) as unknown;
114-
}
115-
}
116-
117-
finalError = finalError || ({} as unknown);
118-
119-
if (opts.throwOnError) {
120-
throw finalError;
121-
}
122-
123-
// Return error response
124-
return opts.responseStyle === 'data'
125-
? undefined
126-
: {
127-
error: finalError,
128-
request,
129-
response: undefined as any,
130-
};
131-
}
98+
let response = await _fetch(request);
13299

133100
for (const fn of interceptors.response.fns) {
134101
if (fn) {

examples/openapi-ts-fetch/src/client/client/client.gen.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -95,40 +95,7 @@ export const createClient = (config: Config = {}): Client => {
9595
// fetch must be assigned here, otherwise it would throw the error:
9696
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
9797
const _fetch = opts.fetch!;
98-
let response: Response;
99-
100-
try {
101-
response = await _fetch(request);
102-
} catch (error) {
103-
// Handle fetch exceptions (AbortError, network errors, etc.)
104-
let finalError = error;
105-
106-
for (const fn of interceptors.error.fns) {
107-
if (fn) {
108-
finalError = (await fn(
109-
error,
110-
undefined as any,
111-
request,
112-
opts,
113-
)) as unknown;
114-
}
115-
}
116-
117-
finalError = finalError || ({} as unknown);
118-
119-
if (opts.throwOnError) {
120-
throw finalError;
121-
}
122-
123-
// Return error response
124-
return opts.responseStyle === 'data'
125-
? undefined
126-
: {
127-
error: finalError,
128-
request,
129-
response: undefined as any,
130-
};
131-
}
98+
let response = await _fetch(request);
13299

133100
for (const fn of interceptors.response.fns) {
134101
if (fn) {

examples/openapi-ts-openai/src/client/client/client.gen.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -95,40 +95,7 @@ export const createClient = (config: Config = {}): Client => {
9595
// fetch must be assigned here, otherwise it would throw the error:
9696
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
9797
const _fetch = opts.fetch!;
98-
let response: Response;
99-
100-
try {
101-
response = await _fetch(request);
102-
} catch (error) {
103-
// Handle fetch exceptions (AbortError, network errors, etc.)
104-
let finalError = error;
105-
106-
for (const fn of interceptors.error.fns) {
107-
if (fn) {
108-
finalError = (await fn(
109-
error,
110-
undefined as any,
111-
request,
112-
opts,
113-
)) as unknown;
114-
}
115-
}
116-
117-
finalError = finalError || ({} as unknown);
118-
119-
if (opts.throwOnError) {
120-
throw finalError;
121-
}
122-
123-
// Return error response
124-
return opts.responseStyle === 'data'
125-
? undefined
126-
: {
127-
error: finalError,
128-
request,
129-
response: undefined as any,
130-
};
131-
}
98+
let response = await _fetch(request);
13299

133100
for (const fn of interceptors.response.fns) {
134101
if (fn) {

examples/openapi-ts-pinia-colada/src/client/client/client.gen.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -85,35 +85,7 @@ export const createClient = (config: Config = {}): Client => {
8585
// fetch must be assigned here, otherwise it would throw the error:
8686
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
8787
const _fetch = opts.fetch!
88-
let response: Response
89-
90-
try {
91-
response = await _fetch(request)
92-
} catch (error) {
93-
// Handle fetch exceptions (AbortError, network errors, etc.)
94-
let finalError = error
95-
96-
for (const fn of interceptors.error.fns) {
97-
if (fn) {
98-
finalError = (await fn(error, undefined as any, request, opts)) as unknown
99-
}
100-
}
101-
102-
finalError = finalError || ({} as unknown)
103-
104-
if (opts.throwOnError) {
105-
throw finalError
106-
}
107-
108-
// Return error response
109-
return opts.responseStyle === 'data'
110-
? undefined
111-
: {
112-
error: finalError,
113-
request,
114-
response: undefined as any
115-
}
116-
}
88+
let response = await _fetch(request)
11789

11890
for (const fn of interceptors.response.fns) {
11991
if (fn) {

examples/openapi-ts-tanstack-angular-query-experimental/src/client/@tanstack/angular-query-experimental.gen.ts

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,12 @@ import type {
4040
DeletePetData,
4141
DeleteUserData,
4242
FindPetsByStatusData,
43-
FindPetsByStatusResponse,
4443
FindPetsByTagsData,
45-
FindPetsByTagsResponse,
4644
GetInventoryData,
47-
GetInventoryResponse,
4845
GetOrderByIdData,
49-
GetOrderByIdResponse,
5046
GetPetByIdData,
51-
GetPetByIdResponse,
5247
GetUserByNameData,
53-
GetUserByNameResponse,
5448
LoginUserData,
55-
LoginUserResponse,
5649
LogoutUserData,
5750
PlaceOrderData,
5851
PlaceOrderResponse,
@@ -167,12 +160,7 @@ export const findPetsByStatusQueryKey = (
167160
export const findPetsByStatusOptions = (
168161
options: Options<FindPetsByStatusData>,
169162
) =>
170-
queryOptions<
171-
FindPetsByStatusResponse,
172-
DefaultError,
173-
FindPetsByStatusResponse,
174-
ReturnType<typeof findPetsByStatusQueryKey>
175-
>({
163+
queryOptions({
176164
queryFn: async ({ queryKey, signal }) => {
177165
const { data } = await findPetsByStatus({
178166
...options,
@@ -194,12 +182,7 @@ export const findPetsByTagsQueryKey = (options: Options<FindPetsByTagsData>) =>
194182
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
195183
*/
196184
export const findPetsByTagsOptions = (options: Options<FindPetsByTagsData>) =>
197-
queryOptions<
198-
FindPetsByTagsResponse,
199-
DefaultError,
200-
FindPetsByTagsResponse,
201-
ReturnType<typeof findPetsByTagsQueryKey>
202-
>({
185+
queryOptions({
203186
queryFn: async ({ queryKey, signal }) => {
204187
const { data } = await findPetsByTags({
205188
...options,
@@ -246,12 +229,7 @@ export const getPetByIdQueryKey = (options: Options<GetPetByIdData>) =>
246229
* Returns a single pet.
247230
*/
248231
export const getPetByIdOptions = (options: Options<GetPetByIdData>) =>
249-
queryOptions<
250-
GetPetByIdResponse,
251-
DefaultError,
252-
GetPetByIdResponse,
253-
ReturnType<typeof getPetByIdQueryKey>
254-
>({
232+
queryOptions({
255233
queryFn: async ({ queryKey, signal }) => {
256234
const { data } = await getPetById({
257235
...options,
@@ -331,12 +309,7 @@ export const getInventoryQueryKey = (options?: Options<GetInventoryData>) =>
331309
* Returns a map of status codes to quantities.
332310
*/
333311
export const getInventoryOptions = (options?: Options<GetInventoryData>) =>
334-
queryOptions<
335-
GetInventoryResponse,
336-
DefaultError,
337-
GetInventoryResponse,
338-
ReturnType<typeof getInventoryQueryKey>
339-
>({
312+
queryOptions({
340313
queryFn: async ({ queryKey, signal }) => {
341314
const { data } = await getInventory({
342315
...options,
@@ -412,12 +385,7 @@ export const getOrderByIdQueryKey = (options: Options<GetOrderByIdData>) =>
412385
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
413386
*/
414387
export const getOrderByIdOptions = (options: Options<GetOrderByIdData>) =>
415-
queryOptions<
416-
GetOrderByIdResponse,
417-
DefaultError,
418-
GetOrderByIdResponse,
419-
ReturnType<typeof getOrderByIdQueryKey>
420-
>({
388+
queryOptions({
421389
queryFn: async ({ queryKey, signal }) => {
422390
const { data } = await getOrderById({
423391
...options,
@@ -497,12 +465,7 @@ export const loginUserQueryKey = (options?: Options<LoginUserData>) =>
497465
* Log into the system.
498466
*/
499467
export const loginUserOptions = (options?: Options<LoginUserData>) =>
500-
queryOptions<
501-
LoginUserResponse,
502-
DefaultError,
503-
LoginUserResponse,
504-
ReturnType<typeof loginUserQueryKey>
505-
>({
468+
queryOptions({
506469
queryFn: async ({ queryKey, signal }) => {
507470
const { data } = await loginUser({
508471
...options,
@@ -524,12 +487,7 @@ export const logoutUserQueryKey = (options?: Options<LogoutUserData>) =>
524487
* Log user out of the system.
525488
*/
526489
export const logoutUserOptions = (options?: Options<LogoutUserData>) =>
527-
queryOptions<
528-
unknown,
529-
DefaultError,
530-
unknown,
531-
ReturnType<typeof logoutUserQueryKey>
532-
>({
490+
queryOptions({
533491
queryFn: async ({ queryKey, signal }) => {
534492
const { data } = await logoutUser({
535493
...options,
@@ -576,12 +534,7 @@ export const getUserByNameQueryKey = (options: Options<GetUserByNameData>) =>
576534
* Get user detail based on username.
577535
*/
578536
export const getUserByNameOptions = (options: Options<GetUserByNameData>) =>
579-
queryOptions<
580-
GetUserByNameResponse,
581-
DefaultError,
582-
GetUserByNameResponse,
583-
ReturnType<typeof getUserByNameQueryKey>
584-
>({
537+
queryOptions({
585538
queryFn: async ({ queryKey, signal }) => {
586539
const { data } = await getUserByName({
587540
...options,

0 commit comments

Comments
 (0)